|
|
|
show map [? * ?] [2 3 4 5] ;[4 9 16 25] |
show (map [(word ?1 ?2 ?1)] [a b c] [d e f]) ;[ada beb cfc] |
show (map "word [a b c] [d e f]) ;[ad be cf] to dotprod :a :b ; vector dot product op apply "sum (map "product :a :b) end |
to matmul :m1 :m2 [:tm2 transpose :m2] ; multiply two matrices output map [[row] map [[col] dotprod :row :col] :tm2] :m1 end |
show apply [[x] :x+3] [5] ;8 show apply [[x] [output :x+3]] [5] ;8 |
to foo :x output :x+3 end |
print apply [[x] output :x+3] [5] ;Can only use output inside a procedure print apply [[x] [:x+3]] [5] ;8 ;-) |
Appendix B of the book Computer Science Logo Style, Volume 3: Advanced Topics by Brian Harvey [MIT Press, 1987]. |
|
|
|