* Block comment syntax
@ 2014-08-06 2:04 David Michael
2014-08-06 7:28 ` Taylan Ulrich Bayirli/Kammer
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: David Michael @ 2014-08-06 2:04 UTC (permalink / raw)
To: guile-user
Hi,
The block comment documentation[1] claims that the closing "!#" must
appear on its own line, but this doesn't actually seem to be the
case[2]. For example, the line "(display #! comment !# 1)"
successfully outputs "1".
Can anyone clarify whether the documentation needs to be updated, or
if the currently acceptable syntax is unintentional and should be
avoided?
Thanks.
David
[1] http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=doc/ref/api-evaluation.texi;h=a23cf1ae48cf2724d5426eb3e0cf898afbf51604;hb=HEAD#l206
[2] http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=libguile/read.c;h=c2d50afdfda158c8b06c20650009b7f3d175f27f;hb=HEAD#l1391
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Block comment syntax
2014-08-06 2:04 Block comment syntax David Michael
@ 2014-08-06 7:28 ` Taylan Ulrich Bayirli/Kammer
2014-08-06 8:32 ` Marko Rauhamaa
2014-08-06 18:19 ` Mike Gran
2014-08-12 20:24 ` Ludovic Courtès
2 siblings, 1 reply; 7+ messages in thread
From: Taylan Ulrich Bayirli/Kammer @ 2014-08-06 7:28 UTC (permalink / raw)
To: David Michael; +Cc: guile-user
David Michael <fedora.dm0@gmail.com> writes:
> Hi,
>
> The block comment documentation[1] claims that the closing "!#" must
> appear on its own line, but this doesn't actually seem to be the
> case[2]. For example, the line "(display #! comment !# 1)"
> successfully outputs "1".
>
> Can anyone clarify whether the documentation needs to be updated, or
> if the currently acceptable syntax is unintentional and should be
> avoided?
>
> Thanks.
>
> David
>
> [1] http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=doc/ref/api-evaluation.texi;h=a23cf1ae48cf2724d5426eb3e0cf898afbf51604;hb=HEAD#l206
> [2] http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=libguile/read.c;h=c2d50afdfda158c8b06c20650009b7f3d175f27f;hb=HEAD#l1391
While I don't know the answer to your question, Guile 2.0.11 already
seems to support the #| |# syntax, which has been standardized in R7RS,
so I would recommend to use that for block syntax. Syntax highlighting
in Emacs's scheme-mode seems to already know it too, in Emacs 24.3.
Moreover, it can be nested (both per R7RS, and supported in Guile
2.0.11), whereas #! !# apparently can not.
Taylan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Block comment syntax
2014-08-06 7:28 ` Taylan Ulrich Bayirli/Kammer
@ 2014-08-06 8:32 ` Marko Rauhamaa
0 siblings, 0 replies; 7+ messages in thread
From: Marko Rauhamaa @ 2014-08-06 8:32 UTC (permalink / raw)
To: Taylan Ulrich Bayirli/Kammer; +Cc: guile-user
Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>:
>> The block comment documentation[1] claims that the closing "!#" must
>> appear on its own line, but this doesn't actually seem to be the
>> case[2]. For example, the line "(display #! comment !# 1)"
>> successfully outputs "1".
>>
>> Can anyone clarify whether the documentation needs to be updated, or
>> if the currently acceptable syntax is unintentional and should be
>> avoided?
>
> While I don't know the answer to your question, Guile 2.0.11 already
> seems to support the #| |# syntax, which has been standardized in
> R7RS,
The "#!" syntax is there for one purpose only: to support the unix/linux
hash-bang syntax. Every "scripting" language needs to support it. "#|"
can't replace it. I wouldn't use "#!" anywhere else in a guile source
file.
<URL: http://en.wikipedia.org/wiki/Shebang_%28Unix%29>
Marko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Block comment syntax
2014-08-06 2:04 Block comment syntax David Michael
2014-08-06 7:28 ` Taylan Ulrich Bayirli/Kammer
@ 2014-08-06 18:19 ` Mike Gran
2014-08-07 3:23 ` David Michael
2014-08-12 20:25 ` Ludovic Courtès
2014-08-12 20:24 ` Ludovic Courtès
2 siblings, 2 replies; 7+ messages in thread
From: Mike Gran @ 2014-08-06 18:19 UTC (permalink / raw)
To: David Michael, guile-user@gnu.org
On Tuesday, August 5, 2014 7:04 PM, David Michael <fedora.dm0@gmail.com> wrote:
>
>
>Hi,
>
>The block comment documentation[1] claims that the closing "!#" must
>appear on its own line, but this doesn't actually seem to be the
>case[2]. For example, the line "(display #! comment !# 1)"
>successfully outputs "1".
>
>Can anyone clarify whether the documentation needs to be updated, or
>if the currently acceptable syntax is unintentional and should be
>avoided?
The documentation needs to be clarified. The return used to
be required
back in Guile v1.6.x but now !# will terminate any block comment without
a carriage return or line feed.
If you're using #! block comments for containing shell script headers
lines like "#!/bin/sh" or "#!/usr/bin/guile"
it is a good idea to have the terminating !# on its own line, like the
docs suggest, though.
Best practice here is probably to use "#!" block comments only for
containing shell script headers, and use the #| syntax otherwise.
-Mike Gran
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Block comment syntax
2014-08-06 18:19 ` Mike Gran
@ 2014-08-07 3:23 ` David Michael
2014-08-12 20:25 ` Ludovic Courtès
1 sibling, 0 replies; 7+ messages in thread
From: David Michael @ 2014-08-07 3:23 UTC (permalink / raw)
To: Mike Gran; +Cc: guile-user@gnu.org
On Wed, Aug 6, 2014 at 2:19 PM, Mike Gran <spk121@yahoo.com> wrote:
>
> On Tuesday, August 5, 2014 7:04 PM, David Michael <fedora.dm0@gmail.com> wrote:
>>
>>
>>Hi,
>>
>>The block comment documentation[1] claims that the closing "!#" must
>>appear on its own line, but this doesn't actually seem to be the
>>case[2]. For example, the line "(display #! comment !# 1)"
>>successfully outputs "1".
>>
>>Can anyone clarify whether the documentation needs to be updated, or
>>if the currently acceptable syntax is unintentional and should be
>>avoided?
>
>
> The documentation needs to be clarified. The return used to
> be required
> back in Guile v1.6.x but now !# will terminate any block comment without
> a carriage return or line feed.
>
> If you're using #! block comments for containing shell script headers
> lines like "#!/bin/sh" or "#!/usr/bin/guile"
> it is a good idea to have the terminating !# on its own line, like the
> docs suggest, though.
>
> Best practice here is probably to use "#!" block comments only for
> containing shell script headers, and use the #| syntax otherwise.
>
> -Mike Gran
Thanks for the responses; I've restructured my script according to
these suggestions.
David
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Block comment syntax
2014-08-06 2:04 Block comment syntax David Michael
2014-08-06 7:28 ` Taylan Ulrich Bayirli/Kammer
2014-08-06 18:19 ` Mike Gran
@ 2014-08-12 20:24 ` Ludovic Courtès
2 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2014-08-12 20:24 UTC (permalink / raw)
To: David Michael; +Cc: guile-user
David Michael <fedora.dm0@gmail.com> skribis:
> The block comment documentation[1] claims that the closing "!#" must
> appear on its own line, but this doesn't actually seem to be the
> case[2]. For example, the line "(display #! comment !# 1)"
> successfully outputs "1".
Yes, reader.test even has this:
--8<---------------cut here---------------start------------->8---
(pass-if "block comment"
(equal? '(+ 1 2 3)
(read-string "(+ 1 #! this is a\ncomment !# 2 3)")))
--8<---------------cut here---------------end--------------->8---
> Can anyone clarify whether the documentation needs to be updated, or
> if the currently acceptable syntax is unintentional and should be
> avoided?
It’s the documentation that needs to be updated.
Done in commit 1e9249e.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Block comment syntax
2014-08-06 18:19 ` Mike Gran
2014-08-07 3:23 ` David Michael
@ 2014-08-12 20:25 ` Ludovic Courtès
1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2014-08-12 20:25 UTC (permalink / raw)
To: guile-user
Mike Gran <spk121@yahoo.com> skribis:
> The documentation needs to be clarified. The return used to
> be required
> back in Guile v1.6.x but now !# will terminate any block comment without
> a carriage return or line feed.
Yeah I may have introduced the change inadvertently when I refactored
the reader in the 1.8 days.
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-08-12 20:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-06 2:04 Block comment syntax David Michael
2014-08-06 7:28 ` Taylan Ulrich Bayirli/Kammer
2014-08-06 8:32 ` Marko Rauhamaa
2014-08-06 18:19 ` Mike Gran
2014-08-07 3:23 ` David Michael
2014-08-12 20:25 ` Ludovic Courtès
2014-08-12 20:24 ` Ludovic Courtès
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).