Hm, would that nest?
Could you do
(lambda (x)
(lambda(y)
(+ x y)))
or if Scheme doesn't please you:
/x -> /y -> x+y
?
On 2 February 2015 at 10:11, Jan-Pieter Jacobs <[email protected]>
wrote:
> Well, if I'd be using it a lot, I'd write a not-so-beautiful thing
> (which probably other people are going to phrase more eloquently) to make
> the other code look better.
> For instance:
>
> NB. lambda-ifying adverb:
> L =: 1 : '3 : (( [: (( ''=.y'' ,~ ''''''''&([,,~) )&.>@{. , {:) < ;. _1 )
> m)'
>
> Usage:
>
> times =: '|a b|a*b' L
> plus =: '$x y$x+y' L NB. any separator you fancy (but space)
> plus 1 2
> 3
> times 3 4
> 12
>
>
>
> 2015-02-02 10:39 GMT+01:00 alexgian <[email protected]>:
>
> > > On a related note, lambda syntax is not really simple.
> > > Consider:
> > > ((lambda (x y) (+ x y)) 2 3)
> >
> > Well, that's *one* form of lambda syntax, viz. the Scheme variant
> >
> > In Haskell you'd write
> > \x y -> x+y
> >
> > Hardly rocket science. But I think the point is that that however
> > awkwardly you may choose to codify it, lambda is brilliant in its
> > simplicity and accessibility of understanding. Static scoping is a
> > no-brainer for managing complexity.
> >
> > I agree that the inability of abstracting J more than two levels (as
> > already mentioned) is a serious PITA, and probably the most inexplicably
> > klutzy piece of work in an otherwise so elegant system... I mean, needing
> > to combine tacits inside explicits, and gawdknows what other
> work-arounds!
> > Really? We might have got used to it, but I doubt that many in the real
> > world would. But, of course, I could be wrong....
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm