Skip to main content

Timeline for answer to Default for Code Golf: Input/Output methods by MegaTom

Current License: CC BY-SA 3.0

Post Revisions

16 events
when toggle format what by license comment
Jan 22, 2021 at 1:11 comment added MegaTom @Alex This establishes that it is an allowable way of taking input in C, or any other pointer based language. Otherwise, it would be nearly impossible for C to take a list as input.
Jan 20, 2021 at 14:23 comment added Alex How does it affect golfing? It is pretty much the standard way to handle arrays in C. Is the pointer-length pair in the arguments not included in the program length?
Jun 17, 2020 at 9:03 history edited CommunityBot
Commonmark migration
Nov 12, 2017 at 4:56 history rollback user45941
Rollback to Revision 1
Nov 12, 2017 at 4:56 comment added user45941 @KeyuGan Please don't make drastic changes to suggestions.
Nov 9, 2017 at 15:06 comment added Pavel @KeyuGan It's just a technicallity really, the only concievable reason to use pointer types in C# is for interop with native code. It probably won't ever apply.
Nov 9, 2017 at 9:17 comment added Keyu Gan @Pavel It is the same situation with C++. As for C# (I'm not an expert), many answers are based on LINQ and seemingly they cannot be shortened in this way. Besides, I will say yes to use pointer / length encapsule here. I think it will be better if we could give some restrictions on what language could do so, according to meta discussion, while the original answer doesn't. codegolf.meta.stackexchange.com/questions/13210/…
Nov 8, 2017 at 23:51 comment added Pavel @keyugan C# supports both standard arrays and C-style pointers
Nov 8, 2017 at 19:16 history edited Keyu Gan CC BY-SA 3.0
clarification
Oct 30, 2017 at 2:32 history edited Keyu Gan CC BY-SA 3.0
added 2 characters in body
Oct 26, 2017 at 20:14 history edited Keyu Gan CC BY-SA 3.0
added 64 characters in body
Jul 19, 2017 at 20:15 comment added Justin I'd say this should only be for a language where this is the natural representation of an array
Jul 14, 2017 at 9:12 comment added Keyu Gan I don't know whether a language exists where both pointer and array are well-defined. Under such circumstances, it may benefit a lot from this rule. I would still suggest languages which does not regard an array of general type as a first-class object may use a reference to first element and length to replace with array/list inputs.
Jul 12, 2017 at 13:25 comment added MegaTom @KeyuGan I think it should be allowed in any language with pointers (c++, asm ...). Do you know of a language where this would be a problem?
Jul 12, 2017 at 3:46 comment added Keyu Gan Do you think it should be restricted to C?
Jul 10, 2017 at 15:37 history answered MegaTom CC BY-SA 3.0