Here's where the code is : http://rosettacode.org/wiki/Active_object#Factor
I really need dynamic quotations because quotations are inputted by the user.

I was surprised that no combinator defines a similar word to call(.
For example, I thought there would be a bi@( word. Maybe even for all
combinators : cleave(, keep(, etc. However that makes many many new
words.. So add-stack-effect seemed like a good compromise. It's true
though that dynamic quotations are rarely needed and I guess that's
why those words aren't defined.

Also, I was wondering why the slot changer uses "call" instead of
"call( x -- x )". I find it easier to understand when extra arguments
are currified in the quotation rather than left on the stack behind
the object with "with" anyway. And that makes it work with dynamic
quotations.

Jon Harper



On Fri, Feb 26, 2010 at 6:31 PM, Samuel Tardieu <s...@rfc1149.net> wrote:
>
>
> 2010/2/26 Daniel Ehrenberg <micro...@gmail.com>
>
>> Well, I think you could also do this:
>>
>> build-dynamic-quotation '[ _ call( x -- y ) ] bi@
>
> Sure, this is equivalent.But we wanted to be able to "tag" several
> quotations with different stack effects, hence the separate word.
>
>>
>> However, you should reconsider whether you really need to build a
>> dynamic quotation. Remember, building a quotation with curry and
>> compose and fry doesn't necessarily make it dynamic.
>
> Agreed. I'll let Jon explain in which context he did it. I only assisted in
> answering a specific question :)
>
>   Sam
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to