In general, you shouldn't want to do this, as all Factor words
(besides the one I'm about to show you) need a fixed number of
parameters at compile-time. Macros expand at compile-time, so that's
one way to get around the restriction.

The other way it to use a slow word called with-datastack:

{ 1 2 } [ + ] with-datastack

You can also use smart combinators:

[ 2 1 - 3 ] sum-outputs

This works because the quotation infers at compile-time, and
sum-outputs is a "smart" combinator that expands based on the number
of outputs inferred.

You are trying to do a C varargs function, basically, and just as in
C, most Factor words are not varags.

If you have more details about what you want to program, we could help you!

Doug

On Tue, Jun 19, 2012 at 7:05 PM, graham telfer <gakouse...@hotmail.com> wrote:
> The word narray constructs a sequence but needs an integer to tell it how
> many elements to push. If you want to push all the stack elements how do you
> find the stack's depth?
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to