Changeset 40169 in project


Ignore:
Timestamp:
06/02/21 16:09:48 (12 days ago)
Author:
Idiomdrottning
Message:

aif-with-result

File:
1 edited

Legend:

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

    r40167 r40169  
    410410
    411411
     412==== aif-with-result
     413 (aif-with-result (odd? (save 3)) (+ it 4) (+ it 1000))
     414
     415⇒ 7
     416
     417That tests the entire expression but only stores the saved part into {{it}}.
     418
     419Combining {{aif}} and {{with-result}} would do the opposite:
     420
     421 (aif
     422  (with-result (pred? (save 27)))
     423  it #f)
     424
     425That tests 27 and stores 27 into {{it}}, while the pred? call is thrown away.
     426
     427
    412428==== empty?
    413429This is a generic predicate to see if a string is "", a list is '(), a
Note: See TracChangeset for help on using the changeset viewer.