Re: [stack] array theory question

John Cowan <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
John Nowak scripsit:

> > Ah^2.  What you want is Algol 68's "rowing coercion" ("row" being A68
> > jargon for vector, or 1-D array).  This coercion transforms a non-row
> > value into the corresponding row value with one element.
> 
> Very interesting! I suppose the question I'd need to answer is if it's  
> sufficient to only go from scalar -> vector. I think the answer is  
> "no" if functions like 'square' are meant to operate on vectors rather  
> than scalars as then 'square 5' would return a one element vector and  
> I'd be back to the same problem regarding construction. 

Right.  However, rowing can be applied more than once.  Note that in
Algol 68, rowing is not done to the arguments of operators, so that
vector + scalar and matrix + scalar can do the right thing rather
than rowing the scalar and probably throwing an array conformity error
at compile time.

-- 
All Norstrilians knew what laughter was:        John Cowan
it was "pleasurable corrigible malfunction".    [email protected]
        --Cordwainer Smith, Norstrilia
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.