Re: [racket-users] Re: If a thunk is a proc of zero arguments, what is a proc of one argument?

2016-11-13 Thread Eli Barzilay
On Sun, Nov 13, 2016 at 6:48 AM, Ian Barland wrote: > [...] > > Also, in this particular case, my chafing at the extra-characters was > ameliorated by a tip from Eli Barzilay: drop the space after the "λ", > e.g. `(λ(n) (+ n 1))`. It's still quite readable, and whittles

Re: [racket-users] Re: If a thunk is a proc of zero arguments, what is a proc of one argument?

2016-11-13 Thread Ian Barland
> Personally however, I recommend against such a macro ... > This is the kind of feature where everyone's got their own favorite syntax for it. > +1 on this wisdom, for this particular construct. I used my own personalized macro for several years, but finally decided it wasn't worth the cost of

[racket-users] Re: If a thunk is a proc of zero arguments, what is a proc of one argument?

2016-11-13 Thread Jack Firth
I'm assuming you intend to *use* the argument, in which case this is a trickier macro to write than `thunk` because you have to make sure the macro respects scope properly. If you wanted a function that accepts one argument and ignores it, you can use `const`. Otherwise, you can implement a