Changeset 33733 in project for wiki/eggref/4/holes


Ignore:
Timestamp:
11/07/16 17:21:59 (4 years ago)
Author:
juergen
Message:

holes 1.3 with additional colon syntax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/holes

    r33706 r33733  
    2121And the sharp-read-syntax ## adds ease of use.
    2222
     23The macro also provides an alternative syntax for anonymous procedures.
     24##(x y : xpr . xprs) abbreviates (lambda (x y) xpr . xprs)
     25
    2326=== Documentation
    2427
     
    3639numerically while removing dups and considers the resulting list as the
    3740argument list of a procedure, with code as body.
     41
     42Alternatively, searches for a colon in code, checks if the expressions
     43to the left of it are all symbols without dups, and considers those
     44symbols as argument list of a procedure with body the expressions to the
     45right of the colon.
    3846
    3947This macro can be called with sharp-read-syntax ## as well. Note, that
     
    7381(##(list (cons !2! !1!) (cons !1! !2!)) 1 2)
    7482   ; -> '((2 . 1) (1 . 2))
     83(##(x y : (+ x y)) 1 2) ; -> 3
    7584</enscript>
    7685
     
    8190== Last update
    8291
    83 Oct 10, 2016
     92Nov 07, 2016
    8493
    8594== Author
     
    119128
    120129== Version History
     130; 1.3 : added alternative lambda syntax with a colon
    121131; 1.2 : holes now numerically sorted
    122132; 1.1 : bug with adjacent holes fixed, regexes replaced
Note: See TracChangeset for help on using the changeset viewer.