3
votes

What does the following Guile scheme code do?

(eq? y '.)
(cons x '.)

The code is not valid in MzScheme, is there a portable equivalent across scheme implementations?

I am trying to port this code written by someone else. Guile seems to respond to '. with #{.}#, but I'm not sure what it means or how to do this in another scheme.

3

3 Answers

3
votes

Okay, it seems that '. is valid syntax for (string->symbol ".") in Guile, whereas MzScheme at least requires |.| for the period as a symbol.

1
votes

#{.}# is Guile specific way to define the symbol contains some delimiters of Scheme. http://www.gnu.org/software/guile/manual/html_node/Symbol-Read-Syntax.html

For other Scheme dialect, there should be another way.

0
votes

I'm surprised any Scheme system will accept a dot symbol at all. My advice is to use another symbol as (I'm sure you're aware) the dot is a shorthand to represent a pair, and even if you can find a Scheme that will take your code you will likely confuse anyone that has the unfortunate task of actually reading your code.