Do you mean something like this?

    : add-quot ( n -- quot ) '[ _ + ] ;

    { 1 2 3 } 10 add-quot map .

Yields:

{ 11 12 13 }

Note: this works in the listener with the non-optimizing compiler, but if
you tried to use this in compiled you'd need to add a static call effect to
the quot by either making ``add-quot`` inline, or currying it with ``[
call( x -- x ) ]``.




On Fri, Jul 10, 2015 at 8:09 PM, Hugh Aguilar <hughaguila...@yahoo.com>
wrote:

> Jul 9 at 8:19 PM
> I sent this yesterday but it seems to have gotten lost --- if it ends up
> being double-posted, I apologize.
>
> Can quotations in Factor still be executed after the parent function has
> gone out of scope (done its EXIT)? Scheme/Lisp allows this, and they hold
> the local frame of the parent function on the heap rather than on the stack
> so that it persists after the parent function has exited so the quotation
> can still use it. It has to eventually get GC'd. LOTD definitely doesn't
> have GC, because the FMITE is a micro-controller (also because we don't
> have tagged data so there is no way to tell the difference between an
> integer and a pointer except to know this a-priori).
>
> In LOTD I don't allow quotations to be executed after the parent function
> has gone out of scope; the parent function's local-frame is on the stack so
> it is lost when the parent function exits.
>
> In LOTD, a quotation could execute after the parent function has gone out
> of scope if it doesn't access the parent function's local variables --- but
> I disallow this too for consistency. The users should just use :NONAME for
> anonymous functions that persist indefinitely --- quotations are for
> situations where the anonymous function needs to communicate with the
> parent, and it does so either through local variables or (if a bar-feature
> higher-order function was used to call the quotation) on the data-stack.
>
> regards --- Hugh
>
>
>
>
>   On Friday, July 10, 2015 8:55 AM, "
> factor-talk-requ...@lists.sourceforge.net" <
> factor-talk-requ...@lists.sourceforge.net> wrote:
>
>
>
> Send Factor-talk mailing list submissions to
>     factor-talk@lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
>     https://lists.sourceforge.net/lists/listinfo/factor-talk
> or, via email, send a message with subject or body 'help' to
>     factor-talk-requ...@lists.sourceforge.net
>
> You can reach the person managing the list at
>     factor-talk-ow...@lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Factor-talk digest..."
>
>
> Today's Topics:
>
>   1. What do we call a collection of vocabs? (Bj?rn Lindqvist)
>   2. Re: What do we call a collection of vocabs? (John Benediktsson)
>   3. Re: What do we call a collection of vocabs? (Doug Coleman)
>   4. Syntax Highlight in Atom (Steve Tsai ???)
>   5. Re: What do we call a collection of vocabs? (John Porubek)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 10 Jul 2015 02:46:41 +0200
> From: Bj?rn Lindqvist <bjou...@gmail.com>
> Subject: [Factor-talk] What do we call a collection of vocabs?
> To: factor-talk@lists.sourceforge.net
> Message-ID:
>     <CALG+76f4aRH+DJCw6jswGT3z-=4pbsj+q+pza7fkashaxjx...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> There is a correspondence between common languages names for
> programming objects and Forth-inspired languages names:
>
> Python  => Java      => Factor
> function => method    word
> module  => class      vocabulary
> package  => package    ???
>
> So in Python, a collection of functions (and classes) in a file forms
> a module and a collection of modules forms a package. In Java, a
> collection of methods forms a class and a collection of classes forms
> a package. In Factor, a file with words is a vocab but a collection of
> vocabs is what? :) Do we have a name for it?
>
>
> --
> mvh/best regards Bj?rn Lindqvist
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 9 Jul 2015 18:19:10 -0700
> From: John Benediktsson <mrj...@gmail.com>
> Subject: Re: [Factor-talk] What do we call a collection of vocabs?
> To: "factor-talk@lists.sourceforge.net"
>     <factor-talk@lists.sourceforge.net>
> Message-ID:
>     <cakkuuiy7ksiue3jpgmnguzikfpjm8-hkzxdqyshovx2tz8t...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> The only names we have right now are "vocab-root" (vocabularies that share
> a common file directory they are loaded from) or "dictionary" (mapping of
> vocabulary names to vocabularies).
>
> I think "package" would be the best name probably, and we have had some
> ideas in the past on working on a module system:
>
>     https://gist.github.com/jckarter/3440892
>
> The issue is being tracked here:
>
>     https://github.com/slavapestov/factor/issues/641
>
>
>
> On Thu, Jul 9, 2015 at 5:46 PM, Bj?rn Lindqvist <bjou...@gmail.com> wrote:
>
> > There is a correspondence between common languages names for
> > programming objects and Forth-inspired languages names:
> >
> > Python  => Java      => Factor
> > function => method    word
> > module  => class      vocabulary
> > package  => package    ???
> >
> > So in Python, a collection of functions (and classes) in a file forms
> > a module and a collection of modules forms a package. In Java, a
> > collection of methods forms a class and a collection of classes forms
> > a package. In Factor, a file with words is a vocab but a collection of
> > vocabs is what? :) Do we have a name for it?
> >
> >
> > --
> > mvh/best regards Bj?rn Lindqvist
> >
> >
> >
> ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> > https://www.gigenetcloud.com/
> > _______________________________________________
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 3
> Date: Thu, 9 Jul 2015 18:37:24 -0700
> From: Doug Coleman <doug.cole...@gmail.com>
> Subject: Re: [Factor-talk] What do we call a collection of vocabs?
> To: "factor-talk@lists.sourceforge.net"
>     <factor-talk@lists.sourceforge.net>
> Message-ID:
>     <caeb+cxv0dz5ckxjuuh5ffoghe_hfqm1yjtta0fcwr-whv8+...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I think ``dictionary`` would be the Factor way.
>
> Issue 641 talks about renaming words to functions etc.
>
> On Thu, Jul 9, 2015 at 6:19 PM, John Benediktsson <mrj...@gmail.com>
> wrote:
>
> > The only names we have right now are "vocab-root" (vocabularies that
> share
> > a common file directory they are loaded from) or "dictionary" (mapping of
> > vocabulary names to vocabularies).
> >
> > I think "package" would be the best name probably, and we have had some
> > ideas in the past on working on a module system:
> >
> >    https://gist.github.com/jckarter/3440892
> >
> > The issue is being tracked here:
> >
> >    https://github.com/slavapestov/factor/issues/641
> >
> >
> >
> > On Thu, Jul 9, 2015 at 5:46 PM, Bj?rn Lindqvist <bjou...@gmail.com>
> wrote:
> >
> >> There is a correspondence between common languages names for
> >> programming objects and Forth-inspired languages names:
> >>
> >> Python  => Java      => Factor
> >> function => method    word
> >> module  => class      vocabulary
> >> package  => package    ???
> >>
> >> So in Python, a collection of functions (and classes) in a file forms
> >> a module and a collection of modules forms a package. In Java, a
> >> collection of methods forms a class and a collection of classes forms
> >> a package. In Factor, a file with words is a vocab but a collection of
> >> vocabs is what? :) Do we have a name for it?
> >>
> >>
> >> --
> >> mvh/best regards Bj?rn Lindqvist
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Don't Limit Your Business. Reach for the Cloud.
> >> GigeNET's Cloud Solutions provide you with the tools and support that
> >> you need to offload your IT needs and focus on growing your business.
> >> Configured For All Businesses. Start Your Cloud Today.
> >> https://www.gigenetcloud.com/
> >> _______________________________________________
> >> Factor-talk mailing list
> >> Factor-talk@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> > https://www.gigenetcloud.com/
> > _______________________________________________
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 4
> Date: Fri, 10 Jul 2015 14:22:19 +0000
> From: Steve Tsai ??? <tsa...@familysearch.org>
> Subject: [Factor-talk] Syntax Highlight in Atom
> To: "factor-talk@lists.sourceforge.net"
>     <factor-talk@lists.sourceforge.net>
> Message-ID:
>     <d0b1d5cf0303bc4dad68c61de150d2953e26c...@w12088.ldschurch.org>
> Content-Type: text/plain; charset="big5"
>
> Can anyone teach me how to setup atom in order to see syntax highlight? I
> am using Xubuntu to run Factor.
>
> Thanks,
> Steve
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 5
> Date: Fri, 10 Jul 2015 11:54:40 -0400
> From: John Porubek <jporu...@gmail.com>
> Subject: Re: [Factor-talk] What do we call a collection of vocabs?
> To: factor-talk@lists.sourceforge.net
> Message-ID:
>     <CALp=6rhdpzjm_vk-8vuhzumlcop2lu0coh27slds60ddpup...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I seem to recall (dimly from a long time ago) the term "lexicon" being
> used in Forth as the next step in the hierarchy. I.e. word ->
> vocabulary -> lexicon. In Forth, "dictionary" has a much different
> meaning as a searchable list of words. Thus, using "dictionary" here
> for Factor might cause confusion for people coming from a Forth
> background who are drawn to Factor (like me!). No problems with
> "package", however.
>
> -John
>
> On Thu, Jul 9, 2015 at 9:37 PM, Doug Coleman <doug.cole...@gmail.com>
> wrote:
> > I think ``dictionary`` would be the Factor way.
> >
> > Issue 641 talks about renaming words to functions etc.
> >
> > On Thu, Jul 9, 2015 at 6:19 PM, John Benediktsson <mrj...@gmail.com>
> wrote:
> >>
> >> The only names we have right now are "vocab-root" (vocabularies that
> share
> >> a common file directory they are loaded from) or "dictionary" (mapping
> of
> >> vocabulary names to vocabularies).
> >>
> >> I think "package" would be the best name probably, and we have had some
> >> ideas in the past on working on a module system:
> >>
> >>    https://gist.github.com/jckarter/3440892
> >>
> >> The issue is being tracked here:
> >>
> >>    https://github.com/slavapestov/factor/issues/641
> >>
> >>
> >>
> >> On Thu, Jul 9, 2015 at 5:46 PM, Bj?rn Lindqvist <bjou...@gmail.com>
> wrote:
> >>>
> >>> There is a correspondence between common languages names for
> >>> programming objects and Forth-inspired languages names:
> >>>
> >>> Python  => Java      => Factor
> >>> function => method    word
> >>> module  => class      vocabulary
> >>> package  => package    ???
> >>>
> >>> So in Python, a collection of functions (and classes) in a file forms
> >>> a module and a collection of modules forms a package. In Java, a
> >>> collection of methods forms a class and a collection of classes forms
> >>> a package. In Factor, a file with words is a vocab but a collection of
> >>> vocabs is what? :) Do we have a name for it?
> >>>
> >>>
> >>> --
> >>> mvh/best regards Bj?rn Lindqvist
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------------
> >>> Don't Limit Your Business. Reach for the Cloud.
> >>> GigeNET's Cloud Solutions provide you with the tools and support that
> >>> you need to offload your IT needs and focus on growing your business.
> >>> Configured For All Businesses. Start Your Cloud Today.
> >>> https://www.gigenetcloud.com/
> >>> _______________________________________________
> >>> Factor-talk mailing list
> >>> Factor-talk@lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Don't Limit Your Business. Reach for the Cloud.
> >> GigeNET's Cloud Solutions provide you with the tools and support that
> >> you need to offload your IT needs and focus on growing your business.
> >> Configured For All Businesses. Start Your Cloud Today.
> >> https://www.gigenetcloud.com/
> >> _______________________________________________
> >> Factor-talk mailing list
> >> Factor-talk@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> > https://www.gigenetcloud.com/
> > _______________________________________________
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
>
>
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
>
> ------------------------------
>
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
> End of Factor-talk Digest, Vol 109, Issue 6
> *******************************************
>
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to