It occurred to me that if :NONAME had not been conceived as
a trick, but as a fundamental programming construct
{ 1 2 DROP }
it would have become a building block of definitions:
{ 1 2 DROP } : aap
and the talk about quotations could be rephrased:
Must :NONAME (or { ) be allowed with a definition?
or even
Should { be allowed to nest?
These thoughts have been triggered by the implementation of
`` ; ''. It ends both :NONAME and : . In a similar situation
with methods we prefer a matched pair M: .. M; over
M: ... ; . Indeed I experience implementation difficulties
caused by ; ending both : and :NONAME.
I wonder whether it make sense in the context of quotations
to replace :NONAME .... ; by one of
N: ...... N;
(: ...... ;)
[: ...... ;]
{ ...... }
{{ ...... }}
and refrain from having a different notation for quotations,
within definitions,just add the phrase to the standard:
a system shall document whether N: nests.
From all possible notation
In this context [: ... ;] is actually the worst alternative.
I would greatly prefer (: .... ;) .
Groetjes Albert
--
-- Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
> Albert van der Horst <alb...@spenarnc.xs4all.nl> writes:
> > I would greatly prefer (: .... ;) .
> It is really bad idea to use anything containing ")" when
> you lack proper lexer.
Why exactly is it a bad idea to use ) with Forth's space delimited lexing?
You're not placing (: ... ;) inside of comments ( ... ) are you? A space
delimits every token including (: and ;) except for a few Forth words that
find their own delimiter. So, a ) shouldn't be matched unintentionally, as
long as you avoid placing (: ... :) in the self-delimited words which use )
as a delimiter. Those are the two Forth words ( and .( So, you should
only have to avoid ( comments and .( for display for proper use of (: ... :)
> "Aleksej Saushev" <a...@inbox.ru> wrote in message
> news:87wr1vpusz.fsf@inbox.ru...
>> Albert van der Horst <alb...@spenarnc.xs4all.nl> writes:
>>> I would greatly prefer (: .... ;) .
>> It is really bad idea to use anything containing ")" when
>> you lack proper lexer.
> Why exactly is it a bad idea to use ) with Forth's space delimited lexing?
> You're not placing (: ... ;) inside of comments ( ... ) are you? A space
> delimits every token including (: and ;) except for a few Forth words that
> find their own delimiter. So, a ) shouldn't be matched unintentionally, as
> long as you avoid placing (: ... :) in the self-delimited words which use )
> as a delimiter. Those are the two Forth words ( and .( So, you should
> only have to avoid ( comments and .( for display for proper use of (: ... :)
Because a large number of programs, including Thunderbird (my newsreader) automatically represents them as smiley-faces. Interestingly, the quoted text above did not, because it is text format, whereas the original representation on my screen was html, and every ;) was converted to a smiley face.
Cheers,
Elizabeth
-- ==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com
"Forth-based products and Services for real-time
applications since 1973."
==================================================
"Rod Pemberton" <do_not_h...@notemailnot.cmm> writes:
> "Aleksej Saushev" <a...@inbox.ru> wrote in message
> news:87wr1vpusz.fsf@inbox.ru...
>> Albert van der Horst <alb...@spenarnc.xs4all.nl> writes:
>> > I would greatly prefer (: .... ;) .
>> It is really bad idea to use anything containing ")" when
>> you lack proper lexer.
> Why exactly is it a bad idea to use ) with Forth's space delimited lexing?
> You're not placing (: ... ;) inside of comments ( ... ) are you? A space
> delimits every token including (: and ;) except for a few Forth words that
> find their own delimiter. So, a ) shouldn't be matched unintentionally, as
> long as you avoid placing (: ... :) in the self-delimited words which use )
> as a delimiter. Those are the two Forth words ( and .( So, you should
> only have to avoid ( comments and .( for display for proper use of (: ... :)
Perhaps, you don't write programs long enough to bother with commentaries,
or you like to track everything you comment off, or you never comment
part of code off, I don't know. But many other people do comment their code,
and do comment parts of code off regularly. Forth is already broken enough
to use that common delimiters for commentaries, you don't really need to
make things worse.
Besides, in this case all you need is reenterable compiler (this isn't
quite trivial thing in Forth already but anyway), so that you could write
:noname ... [ :noname ... ; ] literal ... ;
Thus, square brackets indicate better what's going on.
(Making compiler operate in dynamically allocated memory is even more
complicated, given Forth's aversion of dynamic memory in general.)
In article <87wr1vpusz....@inbox.ru>, Aleksej Saushev <a...@inbox.ru> wrote:
>Albert van der Horst <alb...@spenarnc.xs4all.nl> writes:
>> I would greatly prefer (: .... ;) .
>It is really bad idea to use anything containing ")" when you lack proper lexer.
Like
(;) (DO) (LOOP) (+LOOP) (?DO)
for the runtime compiled in by ; DO etc. ?
Or having words like
(CREATE) (FIND)
that underly CREATE FIND ?
It is some hassle if you want to comment out code, but that is such
a bad habit, that I don't care much. A block where each line starts
with \ stands out better anyway.
>--
>HE CE3OH...
--
-- Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
> It occurred to me that if :NONAME had not been conceived as
> a trick, but as a fundamental programming construct
> { 1 2 DROP }
> it would have become a building block of definitions:
> { 1 2 DROP } : aap
Improvement:
{ 1 2 DROP AAP }
It is but high time for a postfix stack-based lisp.
After all an xt is just a number, right?
So code = data easily.
> > "Aleksej Saushev" <a...@inbox.ru> wrote in message
> >news:87wr1vpusz.fsf@inbox.ru...
> >> Albert van der Horst <alb...@spenarnc.xs4all.nl> writes:
> >>> I would greatly prefer (: .... ;) .
> >> It is really bad idea to use anything containing ")" when
> >> you lack proper lexer.
> > Why exactly is it a bad idea to use ) with Forth's space delimited lexing?
> > You're not placing (: ... ;) inside of comments ( ... ) are you? A space
> > delimits every token including (: and ;) except for a few Forth words that
> > find their own delimiter. So, a ) shouldn't be matched unintentionally, as
> > long as you avoid placing (: ... :) in the self-delimited words which use )
> > as a delimiter. Those are the two Forth words ( and .( So, you should
> > only have to avoid ( comments and .( for display for proper use of (: ... :)
> Because a large number of programs, including Thunderbird (my
> newsreader) automatically represents them as smiley-faces.
> Interestingly, the quoted text above did not, because it is text format,
> whereas the original representation on my screen was html, and every ;)
> was converted to a smiley face.
> Cheers,
> Elizabeth
> --
> ==================================================
> Elizabeth D. Rather (US & Canada) 800-55-FORTH
> FORTH Inc. +1 310.999.6784
> 5959 West Century Blvd. Suite 700
> Los Angeles, CA 90045http://www.forth.com
> "Forth-based products and Services for real-time
> applications since 1973."
> ==================================================
Tools|Options then on the Display tab unselect "Display emoticons as
graphics".
>> "Aleksej Saushev" <a...@inbox.ru> wrote in message
>> news:87wr1vpusz.fsf@inbox.ru...
>>> Albert van der Horst <alb...@spenarnc.xs4all.nl> writes:
>>> > I would greatly prefer (: .... ;) .
>>> It is really bad idea to use anything containing ")" when
>>> you lack proper lexer.
>> Why exactly is it a bad idea to use ) with Forth's space delimited lexing?
>> You're not placing (: ... ;) inside of comments ( ... ) are you? A space
>> delimits every token including (: and ;) except for a few Forth words that
>> find their own delimiter. So, a ) shouldn't be matched unintentionally, as
>> long as you avoid placing (: ... :) in the self-delimited words which use )
>> as a delimiter. Those are the two Forth words ( and .( So, you should
>> only have to avoid ( comments and .( for display for proper use of (: ... :)
>Perhaps, you don't write programs long enough to bother with commentaries,
>or you like to track everything you comment off, or you never comment
>part of code off, I don't know. But many other people do comment their code,
>and do comment parts of code off regularly. Forth is already broken enough
>to use that common delimiters for commentaries, you don't really need to
>make things worse.
I comment meticulously, and if I want to keep code, I save it in a
source control system. In the next version I remove the code I don't
use. Commenting out code is for people who don't use source control
systems. Code should be saved together with the tests it passes.
What tests are passed by commented out code?
>Besides, in this case all you need is reenterable compiler (this isn't
>quite trivial thing in Forth already but anyway), so that you could write
>:noname ... [ :noname ... ; ] literal ... ;
>Thus, square brackets indicate better what's going on.
For a fundamental construct `` [ :noname '' is way to verbose.
With fundamental constructs one wants to things to become second nature,
you want to forget that you have a reenterable compiler, you don't
want to be reminded that you go interpreting, then start a new
compiler.
>(Making compiler operate in dynamically allocated memory is even more
>complicated, given Forth's aversion of dynamic memory in general.)
If you want LISP you know where to find it.
>--
>HE CE3OH...
Groetjes Albert
--
-- Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst