• Re: [OF] ... worth it?

    From dxf@dxforth@gmail.com to comp.lang.forth on Mon Nov 23 10:20:31 2026
    From Newsgroup: comp.lang.forth

    On 22/11/2026 11:28 pm, albert@spenarnc.xs4all.nl wrote:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    Existing:

    1 floats dup 4 = [if] 38 [ ELSE]
    1 floats dup 4 = [if] 38 [ ELSE]
    dup 8 = [if] 308 [ELSE]
    dup 10 = [if] 4932 [ELSE]
    drop 1 abort" unknown float size"
    [THEN] [THEN] [THEN] constant pmax drop
    What is wrong with
    1 floats 4 = [IF] 38 [THEN]
    1 floats 8 = [IF] 308 [THEN]

    If you have a 1 Floats that is 12309 then you have
    more problems you can throw a stick at.

    It would be a good solution provided the scenario you identify doesn't
    arise. But now that I've implemented [OF] I'd need a reason to get
    rid of it. At this point, I'm not sure what that might be. Not being
    standard isn't an issue for me.

    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Mon Nov 23 13:28:11 2026
    From Newsgroup: comp.lang.forth

    On 23/11/2026 2:37 am, Anton Ertl wrote:
    albert@spenarnc.xs4all.nl writes:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    : [OF] ( x1 x2 -- | x1 )
    OVER = DUP IF NIP THEN POSTPONE [IF] ; IMMEDIATE

    I favour CONDS ... THENS introduced by Anton Ertl.

    As already mentioned in 2022, not by me. And as far as I can see,
    CONDS ... THENS are words that compile a control structure, while [OF]
    is a word that does text-interpretation time conditional compilation.

    Would an interpretive THENS even be possible? In the usual implementations there has to be a [THEN] present for each nest as it serves as a down-count.

    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Mon Nov 23 07:28:48 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    Would an interpretive THENS even be possible?

    Why not?

    In the usual implementations
    there has to be a [THEN] present for each nest as it serves as a down-count.

    And when you see a [THENS], you unnest until you are at a scope
    started by [CONDS] (if I understand correctly what CONDS ... THENS
    does).

    Whether it's worth doing, is another question.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Mon Nov 23 09:16:20 2026
    From Newsgroup: comp.lang.forth

    In article <6b0378bf$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 22/11/2026 11:28 pm, albert@spenarnc.xs4all.nl wrote:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    Existing:

    1 floats dup 4 = [if] 38 [ ELSE]
    1 floats dup 4 = [if] 38 [ ELSE]
    dup 8 = [if] 308 [ELSE]
    dup 10 = [if] 4932 [ELSE]
    drop 1 abort" unknown float size"
    [THEN] [THEN] [THEN] constant pmax drop
    What is wrong with
    1 floats 4 = [IF] 38 [THEN]
    1 floats 8 = [IF] 308 [THEN]

    If you have a 1 Floats that is 12309 then you have
    more problems you can throw a stick at.

    It would be a good solution provided the scenario you identify doesn't
    arise. But now that I've implemented [OF] I'd need a reason to get
    rid of it. At this point, I'm not sure what that might be. Not being >standard isn't an issue for me.


    Being unnecessary is a good reason to get rid of.
    For example I think about getting rid of CREATE DOES> (as a syntax)
    and incorporate the functionality in class M: M; endclass
    This replace the two words CREATE DOES> with class: .
    One word less is a good deal.

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Mon Nov 23 09:21:39 2026
    From Newsgroup: comp.lang.forth

    In article <2026Nov22.163719@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    albert@spenarnc.xs4all.nl writes:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    : [OF] ( x1 x2 -- | x1 )
    OVER = DUP IF NIP THEN POSTPONE [IF] ; IMMEDIATE

    I favour CONDS ... THENS introduced by Anton Ertl.

    As already mentioned in 2022, not by me.

    You have introduced it to me.

    And as far as I can see,
    CONDS ... THENS are words that compile a control structure, while [OF]
    is a word that does text-interpretation time conditional compilation.

    Valid point.


    - anton
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Mon Nov 23 09:34:42 2026
    From Newsgroup: comp.lang.forth

    In article <6b03a4bb$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 23/11/2026 2:37 am, Anton Ertl wrote:
    albert@spenarnc.xs4all.nl writes:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote: >>>> : [OF] ( x1 x2 -- | x1 )
    OVER = DUP IF NIP THEN POSTPONE [IF] ; IMMEDIATE

    I favour CONDS ... THENS introduced by Anton Ertl.

    As already mentioned in 2022, not by me. And as far as I can see,
    CONDS ... THENS are words that compile a control structure, while [OF]
    is a word that does text-interpretation time conditional compilation.

    Would an interpretive THENS even be possible? In the usual implementations >there has to be a [THEN] present for each nest as it serves as a down-count.


    Not tested, depends on the implementation.
    In my book an interpretative version would be

    : [CONDS] ; IMMEDIATE
    : [THENS] ; IMMEDIATE

    Add one line in SKIPPING :

    DUP '[THENS] = IF ( dea) DROP ( nesting count) DROP 0 THEN

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Mon Nov 23 08:42:37 2026
    From Newsgroup: comp.lang.forth

    albert@spenarnc.xs4all.nl writes:
    In article <2026Nov22.163719@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote: >>albert@spenarnc.xs4all.nl writes:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote: >>>>: [OF] ( x1 x2 -- | x1 )
    OVER = DUP IF NIP THEN POSTPONE [IF] ; IMMEDIATE

    I favour CONDS ... THENS introduced by Anton Ertl.

    As already mentioned in 2022, not by me.

    You have introduced it to me.

    When and how is that supposed to have happened?

    In my postings on c.l.f the first occurence of CONDS is in my posting
    from 2022 <2022Jun28.144956@mips.complang.tuwien.ac.at> where I cite
    your claim that you have it from me, and I deny it.

    My memory says that Gordon Charlton presented some way to finish
    several THENs at EuroForth '92 or '94, but when I look at the topics
    of his talks, he did not present it there (at least not in the listed
    talks, maybe as an impromptu talk), or maybe I am confusing him with
    someone else. The name he used for this word was END (IIRC).

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From marcel hendrix@mhx@iae.nl to comp.lang.forth on Mon Nov 23 11:47:18 2026
    From Newsgroup: comp.lang.forth

    On 11/23/2026 9:42 AM, Anton Ertl wrote:
    albert@spenarnc.xs4all.nl writes:
    In article <2026Nov22.163719@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    albert@spenarnc.xs4all.nl writes:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote: >>>>> : [OF] ( x1 x2 -- | x1 )
    OVER = DUP IF NIP THEN POSTPONE [IF] ; IMMEDIATE

    I favour CONDS ... THENS introduced by Anton Ertl.

    As already mentioned in 2022, not by me.

    You have introduced it to me.

    When and how is that supposed to have happened?

    [..]

    My memory says that Gordon Charlton presented some way to finish
    several THENs at EuroForth '92 or '94, but when I look at the topics
    of his talks, he did not present it there (at least not in the listed
    talks, maybe as an impromptu talk), or maybe I am confusing him with
    someone else. The name he used for this word was END (IIRC).

    It traces back to `Miser's CASE` by dxforth :https://dxforth.mirrors.minimaltype.com/miser.html

    -marcel
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Tue Nov 24 19:22:44 2026
    From Newsgroup: comp.lang.forth

    On 23/11/2026 7:42 pm, Anton Ertl wrote:
    albert@spenarnc.xs4all.nl writes:
    In article <2026Nov22.163719@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    albert@spenarnc.xs4all.nl writes:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote: >>>>> : [OF] ( x1 x2 -- | x1 )
    OVER = DUP IF NIP THEN POSTPONE [IF] ; IMMEDIATE

    I favour CONDS ... THENS introduced by Anton Ertl.

    As already mentioned in 2022, not by me.

    You have introduced it to me.

    When and how is that supposed to have happened?

    In my postings on c.l.f the first occurence of CONDS is in my posting
    from 2022 <2022Jun28.144956@mips.complang.tuwien.ac.at> where I cite
    your claim that you have it from me, and I deny it.

    My memory says that Gordon Charlton presented some way to finish
    several THENs at EuroForth '92 or '94, but when I look at the topics
    of his talks, he did not present it there (at least not in the listed
    talks, maybe as an impromptu talk), or maybe I am confusing him with
    someone else. The name he used for this word was END (IIRC).

    What may be an early version of THENS appears in a Wil Baden file 'BADENCON.TXT'. The file I have is date-stamped 1990-01-04.
    It defines the following:

    : END [COMPILE] UNTIL ; IMMEDIATE

    : ENDIF [COMPILE] THEN ; IMMEDIATE

    : UNLESS COMPILE 0= [COMPILE] IF ; IMMEDIATE

    : OF COMPILE OVER COMPILE = [COMPILE] IF COMPILE DROP ; IMMEDIATE

    : THENS ( n) 0 DO ( ) [COMPILE] THEN LOOP; IMMEDIATE

    with the example:

    : CRAPS ( n -- )
    2 OF ." You lose. " ELSE
    3 OF ." You lose. " ELSE
    7 OF ." You win. " ELSE
    11 OF ." You win. " ELSE
    12 OF ." You lose. " ELSE
    ( Otherwise:) . ." is your point. "
    [ 5 ] THENS ;

    AFAIR Baden later used COND THENS in the form we now know it.

    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Tue Nov 24 17:57:14 2026
    From Newsgroup: comp.lang.forth

    In article <2026Nov23.094237@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    albert@spenarnc.xs4all.nl writes:
    In article <2026Nov22.163719@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote: >>>albert@spenarnc.xs4all.nl writes:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote: >>>>>: [OF] ( x1 x2 -- | x1 )
    OVER = DUP IF NIP THEN POSTPONE [IF] ; IMMEDIATE

    I favour CONDS ... THENS introduced by Anton Ertl.

    As already mentioned in 2022, not by me.

    You have introduced it to me.

    When and how is that supposed to have happened?

    Not something to loose sleep over, I didn't say you invented
    it or promoted it. I seem to remember the first time I heard
    about it was from you, maybe not.


    - anton

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21e-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Nov 25 10:32:41 2026
    From Newsgroup: comp.lang.forth

    On 23/11/2026 7:16 pm, albert@spenarnc.xs4all.nl wrote:
    In article <6b0378bf$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 22/11/2026 11:28 pm, albert@spenarnc.xs4all.nl wrote:
    In article <6af9083e$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote: >>>> Existing:

    1 floats dup 4 = [if] 38 [ ELSE]
    1 floats dup 4 = [if] 38 [ ELSE]
    dup 8 = [if] 308 [ELSE]
    dup 10 = [if] 4932 [ELSE]
    drop 1 abort" unknown float size"
    [THEN] [THEN] [THEN] constant pmax drop
    What is wrong with
    1 floats 4 = [IF] 38 [THEN]
    1 floats 8 = [IF] 308 [THEN]

    If you have a 1 Floats that is 12309 then you have
    more problems you can throw a stick at.

    It would be a good solution provided the scenario you identify doesn't
    arise. But now that I've implemented [OF] I'd need a reason to get
    rid of it. At this point, I'm not sure what that might be. Not being
    standard isn't an issue for me.


    Being unnecessary is a good reason to get rid of.
    For example I think about getting rid of CREATE DOES> (as a syntax)
    and incorporate the functionality in class M: M; endclass
    This replace the two words CREATE DOES> with class: .
    One word less is a good deal.

    I think about removing things only to conclude they're necessary.
    If you've spent your money well, there's really nothing to cut.

    --- Synchronet 3.21e-Linux NewsLink 1.2