Timeline for answer to Unnamed Functions in Code Golf by user45941
Current License: CC BY-SA 3.0
Post Revisions
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 27, 2016 at 2:58 | history | edited | user45941 | CC BY-SA 3.0 |
added 229 characters in body; deleted 2 characters in body
|
| Apr 27, 2016 at 2:10 | comment | added | CAD97 |
@isaacg I would count that (though in this trivial example you could reverse them). My guess for good start to wording: 3. Causes a function to be defined after running that was not defined before. Unfortunately then it's again butting up against import math -- there might not be a good simple way to define an answer after all...
|
|
| Apr 27, 2016 at 2:06 | comment | added | izzyg |
@CAD97 An example in python of what I'm talking about is def a(): return b() + 2; def b(): return 3, where ; is a newline and the challenge is return 5. Is a a valid function for this challenge?
|
|
| Apr 26, 2016 at 20:26 | history | edited | user45941 | CC BY-SA 3.0 |
added 10 characters in body
|
| Apr 26, 2016 at 20:26 | comment | added | CAD97 | That was poorly worded but maybe someone more familiar with the workings of non-traditionally-linear languages can phrase it better. | |
| Apr 26, 2016 at 20:25 | comment | added | user45941 | @isaacg Admittedly, I know much less about Pyth than I should. That said, CAD97's solution seems reasonable. That said, the solution function doesn't have to be the last one defined. | |
| Apr 26, 2016 at 20:25 | comment | added | CAD97 |
@isaacg Maybe if we define the "last expression" to mean "last evaluated expression". As such, you could do the equivalent of rest of code <break> var f = <last evaluated expression>. I don't know too much about languages like Pyth personally, but it seems that if the submission either 1. can be assigned to a variable and used like and/or can be used itself as a typically defined function, or 2. contains a delimited expression that fulfills 1 after the rest of the code runs, that it should be an acceptable answer.
|
|
| Apr 26, 2016 at 20:15 | comment | added | izzyg | Why is the last expression the one that has to do it? In a language like Pyth with variable introduction, it might well be shorter to define the helper function second. | |
| Apr 26, 2016 at 19:33 | comment | added | user45941 | @MartinBüttner I think the wording on your answer is fine. Like I said, I think forbidding generating all functions would be better as a standard loophole. | |
| Apr 26, 2016 at 11:53 | comment | added | Martin Ender Mod | Now that you've phrased it like that, this is pretty much exactly the consensus we have. If you think I can improve the wording on that to unambiguously rule out answers that generate "all" functions, let me know (then I think this would be a duplicate). | |
| Apr 26, 2016 at 9:51 | history | answered | user45941 | CC BY-SA 3.0 |