Changeset 39587 in project


Ignore:
Timestamp:
02/08/21 17:27:18 (3 weeks ago)
Author:
juergen
Message:

dotted-lambdas 1.2 docu with new test version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/dotted-lambdas

    r39486 r39587  
    4444With no argument it returns the encapsulated list and with one argument,
    4545an index, returns the list's value at that index.
     46Returns the list's length with negative index.
    4647
    4748==== lambda*
    4849 
    49 <macro>(lambda* (x ... xs ..) xpr . xprs)</macro>
    50 
    51 <macro>(lambda* (x ... xs ...) xpr . xprs)</macro>
    52 
    53 <macro>(lambda* (x ... xs ....) xpr . xprs)</macro>
    54 
    55 <macro>(lambda* (x ...) xpr . xprs)</macro>
    56 
    57 the first three evaluate to (lambda (x ... . xs) xpr . xprs)
    58 making xs callable and checking if xs is of length at most 1,
     50<macro>(lambda* (x !!! xs ..) xpr . xprs)</macro>
     51
     52<macro>(lambda* (x !!! xs ...) xpr . xprs)</macro>
     53
     54<macro>(lambda* (x !!! xs ....) xpr . xprs)</macro>
     55
     56An alternative to (lambda (x ... . xs) xpr . xprs).
     57Makes xs callable and checks if xs is of length at most 1,
    5958arbitrary or at least1, respectively.
    60 The last one evaluates to ordinary (lambda (x ...) xpr . xprs)
    6159
    6260==== define
    6361 
    64 <macro>(define* (name x ... xs ..) xpr . xprs)</macro>
    65 
    66 <macro>(define* (name x ... xs ...) xpr . xprs)</macro>
    67 
    68 <macro>(define* (name x ... xs ....) xpr . xprs)</macro>
    69 
    70 <macro>(define* (name x ...) xpr . xprs)</macro>
    71 
    72 <macro>(define name (lambda* (x ... xs ..) xpr . xprs))</macro>
     62<macro>(define* (name x !!! xs ..) xpr . xprs)</macro>
     63
     64<macro>(define* (name x !!! xs ...) xpr . xprs)</macro>
     65
     66<macro>(define* (name x !!! xs ....) xpr . xprs)</macro>
     67
     68<macro>(define name (lambda* (x !!! xs ..) xpr . xprs))</macro>
    7369
    7470syntactic sugar for, e.g.
     
    9894;-> 3
    9995
     96(lst -1)
     97;-> 4
     98
    10099(condition-case (lst 5) ((exn) #f))
    101 ;-> #f
    102 
    103 (condition-case (lst -1) ((exn) #f))
    104100;-> #f
    105101
     
    128124;-> #f
    129125
    130 ((lambda* (a b) (list a b)) 1 2)
    131 ;-> (quote (1 2))
    132 
    133126((lambda* (as ...) (as)) 1 2 3)
    134127;-> (quote (1 2 3))
     
    178171== Last update
    179172
    180 Jan 6, 2021
     173Feb 8, 2021
    181174
    182175== Author
     
    216209
    217210== Version history
     211; 1.2 : new test version
    218212; 1.1 : define* added
    219213; 1.0 : Initial check in
     214
Note: See TracChangeset for help on using the changeset viewer.