forgot to include the list in the correspondence. This is the (happy) outcome...
---------- Forwarded message ---------- From: David Rush kumoyuki@gmail.com Date: 10 June 2012 15:44 Subject: Re: [gambit-list] Puzzlement (different behavior of compiled code) To: Mikael mikael.rcv@gmail.com
Ta much Mikael!
It turns out that the -:s flag to gsc is the culprit. I had been using that flag out of habit to get the syntax-case expander - apparently it also interferes with recognizing keywords. I think i need "-:S" instead, which i guess has been added since I last update my Gambit makefiles (don't ask - it's been a while)
thanks again
- d
On 10 June 2012 15:27, David Rush kumoyuki@gmail.com wrote:
On 10 June 2012 14:31, Mikael mikael.rcv@gmail.com wrote:
Uh this is funny:
(open-output-file '(|path:| "test.flog" |create:| maybe |append:| #t))
look there, there's |:s around the keywords. This means they're *not* actually keywords but *symbols* that kind of look like keywords.
That is interesting. I have no idea why, as I said it's the same code in both cases (code was included in the tail of the OP)
Tried to reproduce your error on 4.6.2:
$ cat a.scm (write (cons abcde: 123)) $ gsi a.scm (abcde: . 123)$ gsc -exe a.scm $ ./a (abcde: . 123)
I wonder if mine is a case that occurs because the code renames cons (in an attempt to avoid variable capture while expanding macros) so that instead of cons the var referenced is actually _cons_23 - leading to compiler confusion about special cases.
Do you compile this code just with gsc filename.scm or (compile-file "filename.scm") or do you have some preprocessor on it?
from the original message:
drr@dibbuk$ make target=gambit test/bug.gambit gsc -:s -link test/bug.Gambit gcc -I/home/drr/include test/bug.c test/bug_.c -o test/bug.gambit \ -L/home/drr/lib -lgambc -lm -lutil -ldl
which is something of a habit i have with Gambit going back many years in order to actually insert a lot of gcc optimization flags (*not* included in this test case)
Do you see any other reasons for why this occured?
just what I suggested above. It gives me something to try anyway.
d
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt
-- GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt
Afficher les réponses par date
On 2012-06-10, at 10:47 AM, David Rush wrote:
From: David Rush kumoyuki@gmail.com Date: 10 June 2012 15:44 Subject: Re: [gambit-list] Puzzlement (different behavior of compiled code) To: Mikael mikael.rcv@gmail.com
Ta much Mikael!
It turns out that the -:s flag to gsc is the culprit. I had been using that flag out of habit to get the syntax-case expander - apparently it also interferes with recognizing keywords. I think i need "-:S" instead, which i guess has been added since I last update my Gambit makefiles (don't ask - it's been a while)
thanks again
Note that with -:S Gambit recognizes the keyword syntax, but does not implement syntax-case. So I don't think that is what you want (if you want define-syntax).
Marc
On 10 June 2012 16:09, Marc Feeley feeley@iro.umontreal.ca wrote:
On 2012-06-10, at 10:47 AM, David Rush wrote:
also interferes with recognizing keywords. I think i need "-:S" instead, which i guess has been added since I last update my Gambit makefiles (don't ask - it's been a while)
Note that with -:S Gambit recognizes the keyword syntax, but does not implement syntax-case. So I don't think that is what you want (if you want define-syntax).
Oh dear, I think the documentation is perhaps a bit confusing on this topic.
from the comments on run-time options.
"The ‘s’ option selects standard Scheme mode. In this mode the reader is case-insensitive and keywords are not recognized. The ‘S’ option selects Gambit Scheme mode (the reader is case-sensitive and recognizes keywords which end with a colon). By default Gambit Scheme mode is used."
and then there's the comment on define-syntax
"Define name as a macro special form whose expansion is specified by expander. This form is available only when the runtime option ‘-:s’ is used. This option causes the loading of the ~~lib/syntax-case support library, which is the Hieb and Dybvig portable syntax-case implementation which has been ported to the Gambit interpreter and compiler. Note that this implementation of syntax-case does not support special forms that are specific to Gambit."
I will grant that the two options are only superficially similar, but I found it easy to confuse. How hard is it to get Hieb & Dybvig's expander to work with the Gambit-mode reader? In any case, I'm sure this is why I built Al* Petrofsky's syntax-rules expander into my preprocessor, so it is certainly not a show-stopper for me *now*.
Thanks again to all for the clarification
What is the objective with your preprocessor, may Black Hole be of use? Brgds
2012/6/10 David Rush kumoyuki@gmail.com
On 10 June 2012 16:09, Marc Feeley feeley@iro.umontreal.ca wrote:
On 2012-06-10, at 10:47 AM, David Rush wrote:
also interferes with recognizing keywords. I think i need "-:S" instead, which i guess has been added since I last update my Gambit makefiles (don't ask - it's been a while)
Note that with -:S Gambit recognizes the keyword syntax, but does not implement syntax-case. So I don't think that is what you want (if you
want
define-syntax).
Oh dear, I think the documentation is perhaps a bit confusing on this topic.
from the comments on run-time options.
"The ‘s’ option selects standard Scheme mode. In this mode the reader is case-insensitive and keywords are not recognized. The ‘S’ option selects Gambit Scheme mode (the reader is case-sensitive and recognizes keywords which end with a colon). By default Gambit Scheme mode is used."
and then there's the comment on define-syntax
"Define name as a macro special form whose expansion is specified by expander. This form is available only when the runtime option ‘-:s’ is used. This option causes the loading of the ~~lib/syntax-case support library, which is the Hieb and Dybvig portable syntax-case implementation which has been ported to the Gambit interpreter and compiler. Note that this implementation of syntax-case does not support special forms that are specific to Gambit."
I will grant that the two options are only superficially similar, but I found it easy to confuse. How hard is it to get Hieb & Dybvig's expander to work with the Gambit-mode reader? In any case, I'm sure this is why I built Al* Petrofsky's syntax-rules expander into my preprocessor, so it is certainly not a show-stopper for me *now*.
Thanks again to all for the clarification
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list