|
From: John B. <mr...@gm...> - 2015-07-12 21:41:10
|
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 <hug...@ya...>
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, "
> fac...@li..." <
> fac...@li...> wrote:
>
>
>
> Send Factor-talk mailing list submissions to
> fac...@li...
>
> 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
> fac...@li...
>
> You can reach the person managing the list at
> fac...@li...
>
> 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 <bj...@gm...>
> Subject: [Factor-talk] What do we call a collection of vocabs?
> To: fac...@li...
> Message-ID:
> <CAL...@ma...>
> 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 <mr...@gm...>
> Subject: Re: [Factor-talk] What do we call a collection of vocabs?
> To: "fac...@li..."
> <fac...@li...>
> Message-ID:
> <CAK...@ma...>
> 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 <bj...@gm...> 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
> > Fac...@li...
> > 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 <dou...@gm...>
> Subject: Re: [Factor-talk] What do we call a collection of vocabs?
> To: "fac...@li..."
> <fac...@li...>
> Message-ID:
> <CAE...@ma...>
> 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 <mr...@gm...>
> 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 <bj...@gm...>
> 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
> >> Fac...@li...
> >> 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
> > Fac...@li...
> > 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 ??? <Ts...@fa...>
> Subject: [Factor-talk] Syntax Highlight in Atom
> To: "fac...@li..."
> <fac...@li...>
> Message-ID:
> <D0B...@W1...>
> 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 <jpo...@gm...>
> Subject: Re: [Factor-talk] What do we call a collection of vocabs?
> To: fac...@li...
> Message-ID:
> <CAL...@ma...>
> 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 <dou...@gm...>
> 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 <mr...@gm...>
> 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 <bj...@gm...>
> 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
> >>> Fac...@li...
> >>> 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
> >> Fac...@li...
> >> 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
> > Fac...@li...
> > 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
> Fac...@li...
> 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
> Fac...@li...
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
|