@ -1,27 +1,27 @@
( meditations
( meditations
"Sequence comprehensions can bind each element in turn to a symbol"
"Sequence comprehensions can bind each element in turn to a symbol"
( = __
( = __
( for [ index ( range 6 ) ]
( for [ x ( range 6 ) ]
inde x) )
x) )
"They can easily emulate mapping"
"They can easily emulate mapping"
( = ' ( 0 1 4 9 16 25 )
( = ' ( 0 1 4 9 16 25 )
( map ( fn [ index] ( * index inde x) )
( map ( fn [ x] ( * x x) )
( range 6 ) )
( range 6 ) )
( for [ index ( range 6 ) ]
( for [ x ( range 6 ) ]
__ ) )
__ ) )
"And also filtering"
"And also filtering"
( = ' ( 1 3 5 7 9 )
( = ' ( 1 3 5 7 9 )
( filter odd? ( range 10 ) )
( filter odd? ( range 10 ) )
( for [ index __ :when ( odd? inde x) ]
( for [ x __ :when ( odd? x) ]
inde x) )
x) )
"Combinations of these transformations is trivial"
"Combinations of these transformations is trivial"
( = ' ( 1 9 25 49 81 )
( = ' ( 1 9 25 49 81 )
( map ( fn [ index] ( * index inde x) )
( map ( fn [ x] ( * x x) )
( filter odd? ( range 10 ) ) )
( filter odd? ( range 10 ) ) )
( for [ index ( range 10 ) :when __ ]
( for [ x ( range 10 ) :when __ ]
__ ) )
__ ) )
"More complex transformations simply take multiple binding forms"
"More complex transformations simply take multiple binding forms"