Changeset 40151 in project


Ignore:
Timestamp:
05/27/21 11:24:39 (2 weeks ago)
Author:
Idiomdrottning
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/brev-separate

    r40137 r40151  
    283283
    284284
     285==== fn
     286 (fn body ...)
     287
     288is shorthand for
     289
     290 (lambda some-basic-bindings body ...)
     291
     292where some-basic-bindings is one of
     293
     294* args
     295* (x . rest)
     296* (x y . rest)
     297* (x y z . rest)
     298
     299and the fn macro automatically figures out which of those four you mean.
     300
     301
    285302==== over
    286  (over bindings body ...)
     303 (over body ...)
    287304
    288305is shorthand for
    289306
    290  (cut map (lambda bindings body ...) <>)
    291 
    292 except that the map can take any number of lists (as many as there are bindings in {{bindings}}).
     307 (cut map (lambda some-basic-bindings body ...) <>)
     308
     309except that the map can take any number of lists and that {{i}} is also anaphorically bound to the list index in {{body}}.
    293310
    294311Here is an example:
    295312
    296  ((over (x y) (+ x x y))
     313 ((over (+ x x y i))
    297314  '(10 20 40) '(3 6 9))
    298315
    299 â‡’ (23 46 89)
     316⇒ (23 47 91)
    300317
    301318
Note: See TracChangeset for help on using the changeset viewer.