Re: [Factor-talk] Qualified identifiers
I could not figure out whether the `:` word creates the alias with the `vocab:` prefix, or it's somehow supported by the parser, so I didn't update the documentation for `:`, only for the `USE:` and `USING:` words. 01.08.2020, 22:52, "Alexander Ilin" :Created PR #2320. 01.08.2020, 16:41, "John Benediktsson":Good point. When that feature was added, probably the documentation was not improved in the places you mention. Let’s fix that!Best,John. On Aug 1, 2020, at 6:29 AM, Alexander Ilin wrote: Hello! Is it documented anywhere that the Factor words can be qualified by prefixing them with the "vocab:"? This may be self-evident to people familiar with the Forth family of languages, but I studied Factor by its built-in documentation before any other such languages, and was quite surprised when I discovered that this trick works. This tells me that it was probably never mentioned in the docs. I think it should be stated somewhere, otherwise it's not clear that the use of words like QUALIFIED: is extra syntax, which amends the already existing basis. To rephrase what I mean, here's an example from the QUALIFIED: docs: USING: prettyprint ; QUALIFIED: math 1 2 math:+ . 3 What I missed in the _other_ Factor syntax documentation, is that even without using QUALIFIED: it's possible to qualify and disambiguate with the following syntax: USING: prettyprint math ; 1 2 math:+ . 3 Here, the "math:" prefix is optional, but it can be used. For example, in the "Factor handbook » The language » Words » Colon definitions" article it could be mentioned that both "word" and "vocab:word" aliases are defined, if that's indeed how it works. The USE:/USING: documentation at "Factor handbook » The language » Syntax » Parse-time word lookup » Syntax to control word lookup" also doesn't mention that all the imported words can be used with the optional vocab name prefix, even though it mentions the possible ambiguity issues. ---=--- Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk___Factor-talk mailing listFactor-talk@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/factor-talk ---=---Александр ,,___Factor-talk mailing listFactor-talk@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/factor-talk ---=---Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Qualified identifiers
Created PR #2320. 01.08.2020, 16:41, "John Benediktsson" :Good point. When that feature was added, probably the documentation was not improved in the places you mention. Let’s fix that!Best,John. On Aug 1, 2020, at 6:29 AM, Alexander Ilinwrote: Hello! Is it documented anywhere that the Factor words can be qualified by prefixing them with the "vocab:"? This may be self-evident to people familiar with the Forth family of languages, but I studied Factor by its built-in documentation before any other such languages, and was quite surprised when I discovered that this trick works. This tells me that it was probably never mentioned in the docs. I think it should be stated somewhere, otherwise it's not clear that the use of words like QUALIFIED: is extra syntax, which amends the already existing basis. To rephrase what I mean, here's an example from the QUALIFIED: docs: USING: prettyprint ; QUALIFIED: math 1 2 math:+ . 3 What I missed in the _other_ Factor syntax documentation, is that even without using QUALIFIED: it's possible to qualify and disambiguate with the following syntax: USING: prettyprint math ; 1 2 math:+ . 3 Here, the "math:" prefix is optional, but it can be used. For example, in the "Factor handbook » The language » Words » Colon definitions" article it could be mentioned that both "word" and "vocab:word" aliases are defined, if that's indeed how it works. The USE:/USING: documentation at "Factor handbook » The language » Syntax » Parse-time word lookup » Syntax to control word lookup" also doesn't mention that all the imported words can be used with the optional vocab name prefix, even though it mentions the possible ambiguity issues. ---=--- Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk___Factor-talk mailing listFactor-talk@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/factor-talk ---=---Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Qualified identifiers
Good point. When that feature was added, probably the documentation was not improved in the places you mention. Let’s fix that! Best, John. > On Aug 1, 2020, at 6:29 AM, Alexander Ilin wrote: > > Hello! > > Is it documented anywhere that the Factor words can be qualified by > prefixing them with the "vocab:"? > This may be self-evident to people familiar with the Forth family of > languages, but I studied Factor by its built-in documentation before any > other such languages, and was quite surprised when I discovered that this > trick works. This tells me that it was probably never mentioned in the docs. > > I think it should be stated somewhere, otherwise it's not clear that the use > of words like QUALIFIED: is extra syntax, which amends the already existing > basis. > > To rephrase what I mean, here's an example from the QUALIFIED: docs: > USING: prettyprint ; > QUALIFIED: math > 1 2 math:+ . > 3 > > What I missed in the _other_ Factor syntax documentation, is that even > without using QUALIFIED: it's possible to qualify and disambiguate with the > following syntax: > USING: prettyprint math ; > 1 2 math:+ . > 3 > > Here, the "math:" prefix is optional, but it can be used. > > For example, in the "Factor handbook » The language » Words » Colon > definitions" article it could be mentioned that both "word" and "vocab:word" > aliases are defined, if that's indeed how it works. The USE:/USING: > documentation at "Factor handbook » The language » Syntax » Parse-time word > lookup » Syntax to control word lookup" also doesn't mention that all the > imported words can be used with the optional vocab name prefix, even though > it mentions the possible ambiguity issues. > > ---=--- > Александр > > > > > ___ > 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
[Factor-talk] Qualified identifiers
Hello! Is it documented anywhere that the Factor words can be qualified by prefixing them with the "vocab:"? This may be self-evident to people familiar with the Forth family of languages, but I studied Factor by its built-in documentation before any other such languages, and was quite surprised when I discovered that this trick works. This tells me that it was probably never mentioned in the docs. I think it should be stated somewhere, otherwise it's not clear that the use of words like QUALIFIED: is extra syntax, which amends the already existing basis. To rephrase what I mean, here's an example from the QUALIFIED: docs: USING: prettyprint ; QUALIFIED: math 1 2 math:+ . 3 What I missed in the _other_ Factor syntax documentation, is that even without using QUALIFIED: it's possible to qualify and disambiguate with the following syntax: USING: prettyprint math ; 1 2 math:+ . 3 Here, the "math:" prefix is optional, but it can be used. For example, in the "Factor handbook » The language » Words » Colon definitions" article it could be mentioned that both "word" and "vocab:word" aliases are defined, if that's indeed how it works. The USE:/USING: documentation at "Factor handbook » The language » Syntax » Parse-time word lookup » Syntax to control word lookup" also doesn't mention that all the imported words can be used with the optional vocab name prefix, even though it mentions the possible ambiguity issues. ---=--- Александр ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk