Hi Georg,

If you run it, you'll see it produces the result you would expect:

     IN: scratchpad 1 2 3 4 4 narray .
     { 1 2 3 4 }

The reason it "produces a quot" is that it is implemented as a macro that 
generates a quotation to do the work (in this case with a stack effect 
consuming 4 items and producing 1 array).

Try this;

    [ 4 narray ] expand-macros

You can also try this:

    [ 4 narray ] infer

Hope that helps!

Maybe our documentation should say something about the quot, but it makes the 
stack effect a little busy:

    MACRO: narray ( n -- quot: ( n.. -- array ) )



> On Aug 6, 2015, at 6:59 AM, Georg Simon <georg.si...@auge.de> wrote:
> 
> http://docs.factorcode.org/content/word-narray,sequences.generalizations.html
> 
> Why is the stack effect ( n -- quot ) and not ( n -- array ) ?
> 
> Why does the stack effect show quot as result for the following words
> nsequence, firstn, and set-firstn ?
> ------------------------------------------------------------------------------
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

------------------------------------------------------------------------------
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to