Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Functional programming in REBOL

From: lmecir:mbox:vol:cz at: 10-Aug-2001 9:31

Hi,
> I just went back and checked the source for that puzzle and it should have > been written > > puzzle: dupx (uncurry :dupx) > > which makes sense because dupx returns a function of one arg, which is > consumed by uncurry which returns a function of two args which is consumed > by dupx which returns a function of one arg. So the idea is we use uncurry > to change dupx so that it can be applied to itself. > > > > dupx: cfunc [f2][func [x][f2 :x :x]] > > > uncurry: cfunc [f][func [x y][do f :x :y]] > > > > > > What does the function puzzle do?
It works like function: puzzle2: func [x] [x :x :x]