Comments in Joy

Nick Forde — 2002-03-28 13:40:36

Manfred,

Could I make a small request for line comments in Joy? I for one would
find them really useful for temporarily removing lines of code during
development. Especially where they already contain block comments.

My preference would be '#' for this purpose, only because it is used
by so many other interpreted languages, and because it fits well with
unix scripts headed with '#!/usr/local/bin/joy'.

A small request and only a small change required to scan.c:

112a113,117
> case '#':
> {
> currentcolumn = linelength;
> getch(); goto Start;
> }


Of course this also means you can remove the little hack on lines
141-144 of main.c :-)

Regards,

Nick.

Heiko.Kuhrt@t-online.de — 2002-03-30 15:59:51

On Thu, 28 Mar 2002, Nick Forde wrote:

> Manfred,
>
> Could I make a small request for line comments in Joy? I for one would
> find them really useful for temporarily removing lines of code during
> development. Especially where they already contain block comments.
>
> My preference would be '#' for this purpose, only because it is used
> by so many other interpreted languages, and because it fits well with
> unix scripts headed with '#!/usr/local/bin/joy'.
>
> A small request and only a small change required to scan.c:
>
> 112a113,117
> > case '#':
> > {
> > currentcolumn = linelength;
> > getch(); goto Start;
> > }
>
>
> Of course this also means you can remove the little hack on lines
> 141-144 of main.c :-)
>
> Regards,
>
> Nick.
>

This is in my opinion really a very good idea.

BTW: Joy is one of the few languages where word comments wold make sense.

-Heiko

Manfred von Thun — 2002-04-03 06:51:27

On Thu, 28 Mar 2002, Nick Forde wrote:

> Manfred,
>
> Could I make a small request for line comments in Joy? I for one would
> find them really useful for temporarily removing lines of code during
> development. Especially where they already contain block comments.

Yes, a similar request was made a long time ago, I think.

> My preference would be '#' for this purpose, only because it is used
> by so many other interpreted languages, and because it fits well with
> unix scripts headed with '#!/usr/local/bin/joy'.
>
> A small request and only a small change required to scan.c:
>
> 112a113,117
> > case '#':
> > {
> > currentcolumn = linelength;
> > getch(); goto Start;
> > }

Done. See the Joy web page.

> Of course this also means you can remove the little hack on lines
> 141-144 of main.c :-)

I removed those lines, too, as you suggested. But since I am not at all
familiar with command line interpretation, I would like someone to
have a good look at what I've done. (John Cowan - are you still there ?)

> Nick.

Thanks.
- Manfred

John Cowan — 2002-04-05 00:15:56

Manfred von Thun scripsit:

> I removed those lines, too, as you suggested. But since I am not at all
> familiar with command line interpretation, I would like someone to
> have a good look at what I've done. (John Cowan - are you still there ?)

Yes. There's no problem: command line interpretation is being done
in the kernel, so the only thing Joy has to do is ignore lines
beginning with "#". Handling this in a general way suits me fine.

--
John Cowan <jcowan@...> http://www.reutershealth.com
I amar prestar aen, han mathon ne nen, http://www.ccil.org/~cowan
han mathon ne chae, a han noston ne 'wilith. --Galadriel, _LOTR:FOTR_