Andrew wrote: > As 'pair-wise can be extended to three (or more) arguments functions as well. Much like this: >> Apply: function [Blocks [block!] F [any-function!]] [Results F-Block] [ [ Results: none [ if equal? length? Blocks length? first :F [ [ Results: make block! length? first blocks [ repeat i length? first Blocks [ [ F-Block: copy [] [ append F-Block :F [ foreach Block Blocks [ [ append/only F-Block Block/:i [ ] [ append/only Results do F-Block [ ] [ ] [ Results [ ] >> apply [[1.0 3.3]] :form == ["1" "3.3"] >> apply [[1.0 3.3] [2.3 99.0]] :+ == [3.3 102.3] >> apply [[true false true] [["I'm true!"] ["not not"] [1]] [["I'm true!"] ["not"] [0]]] :either == ["I'm true!" "not" 1] Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/ -><-
- [REBOL] Who is that grouch? -or- Fun with functions! joel . neely
- [REBOL] Who is that grouch? -or- Fun with functions! Re: allen
- [REBOL] Who is that grouch? -or- Fun with functions!... joel . neely
- [REBOL] Who is that grouch? -or- Fun with functi... joel . neely
- [REBOL] Who is that grouch? -or- Fun with fu... joel . neely
- [REBOL] Who is that grouch? -or- Fun wi... Al . Bri
- [REBOL] Who is that grouch? -or- Fu... joel . neely
- [REBOL] Who is that grouch? -or... Al . Bri
- [REBOL] Who is that grouch? -or... Al . Bri
- [REBOL] Who is that grouch? -or... allen
- [REBOL] Who is that grouch? -or... lmecir
- [REBOL] Who is that grouch? -or... joel . neely
- [REBOL] Who is that grouch? -or... lmecir
- [REBOL] Who is that grouch? -or... allen
- [REBOL] Who is that grouch? -or... joel . neely
- [REBOL] Cosmetic bug - Help Al . Bri
