manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.17.1.3 Block Comments

In addition to the standard line comments defined by R5RS, Guile has another comment type for multiline comments, called block comments. This type of comment begins with the character sequence #! and ends with the characters !#, which must appear on a line of their own. These comments are compatible with the block comments in the Scheme Shell ‘scsh’ (see section The Scheme shell (scsh)). The characters #! were chosen because they are the magic characters used in shell scripts for indicating that the name of the program for executing the script follows on the same line.

Thus a Guile script often starts like this.

#! /usr/local/bin/guile -s
!#

More details on Guile scripting can be found in the scripting section (see section Guile Scripting).

Similarly, Guile (starting from version 2.0) supports nested block comments as specified by R6RS and SRFI-30:

(+  #| this is a #| nested |# block comment |# 2)
⇒ 3

For backward compatibility, this syntax can be overridden with read-hash-extend (see section read-hash-extend).

There is one special case where the contents of a comment can actually affect the interpretation of code. When a character encoding declaration, such as coding: utf-8 appears in one of the first few lines of a source file, it indicates to Guile’s default reader that this source code file is not ASCII. For details see Character Encoding of Source Files.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 20, 2013 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.