[REBOL] Transpose Re:(3)
From: lmecir:geocities at: 6-Oct-2000 23:46
Hi,
Andrew wrote:
> Why capitals? Here's the Transpose function again:
>
> Transpose: function [
> [catch]
> "Transposes Matrices"
> Matrix [block!]
> ][
> Results Width Height Column
> ][
> Results: make block! Width: length? Matrix/1
> Height: length? Matrix
> repeat Index Width [
> Column: make block! Width
> foreach Row Matrix [
> insert/only tail Column Row/:Index
> ]
> insert/only tail Results Column
> ]
> Results
> ]
>
> Note that every word that is defined here is in Title case. Also note that
> every common word that's in Rebol like 'insert, '/only, 'length? etcetera
> are in lower case. What's _important_ is signalled by the Title case
words.
[...snip...]
> > I assume your [catch] was a faster way of addressing this same issue,
by
> simply passing the error resulting from an empty argument list back to the
> caller.
>
> It's a whole lot simpler and catches the error earlier and it runs faster.
>
> Andrew Martin
> Look what happens when I go to sleep! :-)
> ICQ: 26227169
> http://members.nbci.com/AndrewMartin/
> -><-
>
I would say, that your source is (as long as :make, :block!, :length?,
:repeat, :foreach, :insert, :tail are normal, unchanged natives) exactly
equivalent to the same function not having [catch] refinement, because there
is no Throw for it in the source.
Cheers,
Ladislav