Changeset 30907 in project


Ignore:
Timestamp:
05/23/14 23:55:41 (6 years ago)
Author:
Moritz Heidkamp
Message:

clojurian: Update documentation for 0.0.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/clojurian

    r27265 r30907  
    4747combinator''. The starred version ({{->*}}) is multi value aware,
    4848i.e. each form's return values are spliced into the argument list of
    49 the successing form.
     49the successing form. As a shorthand it is also possible to pass
     50{{proc}} instead of {{(proc)}}.
    5051
    5152Single value example:
     
    9394   (iota 10))))
    9495</enscript>
     96
     97
     98<syntax>(as-> val name forms ...)</syntax>
     99
     100Evaluates {{forms}} in order in a scope where {{name}} is bound to
     101{{val}} for the first form, the result of that for the second form,
     102the result of that for the third form, and so forth. Returns the
     103result of the last form.
     104
     105Examples:
     106
     107<enscript highlight="scheme">
     108(as-> 3 x (+ x 7) (/ x 2)) => 5
     109</enscript>
     110
     111It's mainly useful in combination with {{->}}:
     112
     113<enscript highlight="scheme">
     114(-> 10 (+ 3) (+ 7) (as-> x (/ 200 x))) => 10
     115</enscript>
     116
    95117
    96118
     
    167189==== Version history
    168190
     191; 0.0.5 : Add support for non-parenthesized clauses to the thrushes (thanks Even Hanson). Add {{as->}} (thanks Jan Herich).
    169192; 0.0.4 : Preserve {{#f}} return values of the {{then}} clause in {{if-let*}} (thanks to Andy Bennett for pointing this out)
    170193; 0.0.3 : Prefix all {{clojurian-atom}} identifiers with {{atom-}}
     
    175198
    176199
    177   Copyright (c) 2012, Moritz Heidkamp
     200  Copyright (c) 2014, Moritz Heidkamp
    178201  All rights reserved.
    179202 
Note: See TracChangeset for help on using the changeset viewer.