Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #14265 > unrolled thread

:NONAME a different viewpoint

Started byAlbert van der Horst <albert@spenarnc.xs4all.nl>
First post2012-07-22 14:45 +0000
Last post2012-07-22 23:01 -0700
Articles 11 — 7 participants

Back to article view | Back to comp.lang.forth


Contents

  :NONAME a different viewpoint Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-22 14:45 +0000
    Re: :NONAME a different viewpoint Aleksej Saushev <asau@inbox.ru> - 2012-07-22 21:30 +0400
      Re: :NONAME a different viewpoint "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-07-22 19:28 -0400
        Re: :NONAME a different viewpoint "Elizabeth D. Rather" <erather@forth.com> - 2012-07-22 14:14 -1000
          Re: :NONAME a different viewpoint Alex McDonald <blog@rivadpm.com> - 2012-07-23 04:28 -0700
        Re: :NONAME a different viewpoint Aleksej Saushev <asau@inbox.ru> - 2012-07-23 05:35 +0400
          Re: :NONAME a different viewpoint Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-23 15:38 +0000
      Re: :NONAME a different viewpoint Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-23 03:24 +0000
        Re: :NONAME a different viewpoint Aleksej Saushev <asau@inbox.ru> - 2012-07-25 03:02 +0400
    Re: :NONAME a different viewpoint "A. K." <akk@nospam.org> - 2012-07-23 07:48 +0200
      Re: :NONAME a different viewpoint Paul Rubin <no.email@nospam.invalid> - 2012-07-22 23:01 -0700

#14265 — :NONAME a different viewpoint

FromAlbert van der Horst <albert@spenarnc.xs4all.nl>
Date2012-07-22 14:45 +0000
Subject:NONAME a different viewpoint
Message-ID<m7kgzg.fyf@spenarnc.xs4all.nl>
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

[toc] | [next] | [standalone]


#14272

FromAleksej Saushev <asau@inbox.ru>
Date2012-07-22 21:30 +0400
Message-ID<87wr1vpusz.fsf@inbox.ru>
In reply to#14265
Albert van der Horst <albert@spenarnc.xs4all.nl> writes:

> I would greatly prefer  (: .... ;) .

It is really bad idea to use anything containing ")" when you lack proper lexer.


-- 
HE CE3OH...

[toc] | [prev] | [next] | [standalone]


#14289

From"Rod Pemberton" <do_not_have@notemailnot.cmm>
Date2012-07-22 19:28 -0400
Message-ID<jui285$5hm$1@speranza.aioe.org>
In reply to#14272
"Aleksej Saushev" <asau@inbox.ru> wrote in message
news:87wr1vpusz.fsf@inbox.ru...
> Albert van der Horst <albert@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 (: ... :)


Rod Pemberton



[toc] | [prev] | [next] | [standalone]


#14291

From"Elizabeth D. Rather" <erather@forth.com>
Date2012-07-22 14:14 -1000
Message-ID<f6qdnZD3RrXUCpHNnZ2dnUVZ_qadnZ2d@supernews.com>
In reply to#14289
On 7/22/12 1:28 PM, Rod Pemberton wrote:
> "Aleksej Saushev" <asau@inbox.ru> wrote in message
> news:87wr1vpusz.fsf@inbox.ru...
>> Albert van der Horst <albert@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."
==================================================

[toc] | [prev] | [next] | [standalone]


#14309

FromAlex McDonald <blog@rivadpm.com>
Date2012-07-23 04:28 -0700
Message-ID<2ebd37d1-1d90-46ea-aef5-27c46b4dffdc@3g2000vbx.googlegroups.com>
In reply to#14291
On Jul 23, 1:14 am, "Elizabeth D. Rather" <erat...@forth.com> wrote:
> On 7/22/12 1:28 PM, Rod Pemberton wrote:
>
>
>
>
>
>
>
>
>
> > "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".

[toc] | [prev] | [next] | [standalone]


#14293

FromAleksej Saushev <asau@inbox.ru>
Date2012-07-23 05:35 +0400
Message-ID<87r4s3mf8k.fsf@inbox.ru>
In reply to#14289
"Rod Pemberton" <do_not_have@notemailnot.cmm> writes:

> "Aleksej Saushev" <asau@inbox.ru> wrote in message
> news:87wr1vpusz.fsf@inbox.ru...
>> Albert van der Horst <albert@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.)


-- 
HE CE3OH...

[toc] | [prev] | [next] | [standalone]


#14313

FromAlbert van der Horst <albert@spenarnc.xs4all.nl>
Date2012-07-23 15:38 +0000
Message-ID<m7me3c.kh7@spenarnc.xs4all.nl>
In reply to#14293
In article <87r4s3mf8k.fsf@inbox.ru>, Aleksej Saushev  <asau@inbox.ru> wrote:
>"Rod Pemberton" <do_not_have@notemailnot.cmm> writes:
>
>> "Aleksej Saushev" <asau@inbox.ru> wrote in message
>> news:87wr1vpusz.fsf@inbox.ru...
>>> Albert van der Horst <albert@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

[toc] | [prev] | [next] | [standalone]


#14298

FromAlbert van der Horst <albert@spenarnc.xs4all.nl>
Date2012-07-23 03:24 +0000
Message-ID<m7lg4t.mrx@spenarnc.xs4all.nl>
In reply to#14272
In article <87wr1vpusz.fsf@inbox.ru>, Aleksej Saushev  <asau@inbox.ru> wrote:
>Albert van der Horst <albert@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

[toc] | [prev] | [next] | [standalone]


#14355

FromAleksej Saushev <asau@inbox.ru>
Date2012-07-25 03:02 +0400
Message-ID<87vchcu5jk.fsf@inbox.ru>
In reply to#14298
Albert van der Horst <albert@spenarnc.xs4all.nl> writes:

> In article <87wr1vpusz.fsf@inbox.ru>, Aleksej Saushev  <asau@inbox.ru> wrote:
>>Albert van der Horst <albert@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 ?

Yes. The only reason why it isn't annoying is that these words are not used
frequently.

> It is some hassle if you want to comment out code, but that is such
> a bad habit, that I don't care much.

Commenting code out is not a bad habit. It is storing all unnecessary
side steps in a version control system what constitutes bad habit.

> A block where each line starts
> with \ stands out better anyway.

If it were that way, we wouldn't be using parentheses in natural languages.


-- 
HE CE3OH...

[toc] | [prev] | [next] | [standalone]


#14303

From"A. K." <akk@nospam.org>
Date2012-07-23 07:48 +0200
Message-ID<500ce5b7$0$6549$9b4e6d93@newsspool4.arcor-online.net>
In reply to#14265
On 22.07.2012 16:45, Albert van der Horst wrote:
> 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.


[toc] | [prev] | [next] | [standalone]


#14304

FromPaul Rubin <no.email@nospam.invalid>
Date2012-07-22 23:01 -0700
Message-ID<7x8vebvwvr.fsf@ruckus.brouhaha.com>
In reply to#14303
"A. K." <akk@nospam.org> writes:
> It is but high time for a postfix stack-based lisp.

http://factorcode.org/ 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.forth


csiph-web