Hi,
Can I use define-syntax without runtime option "-:s"? I tried the reference implemantation of SRFI-64 but it would not work without "-:s" because it uses define-syntax. But I don't want to lose Gambit-C specific features.
Thanks,
Afficher les réponses par date
hmm what gambit specific features are broken with -:s? Also can't you: (load "~~lib/syntax-case") for whatever program needs syntax-case?
I think that perhaps you are misread the note in the docs. It does not say that you loose gambit specific features. It says that the implementation of syntax-case does not support them. Unless I am the one misreading your email or docs...
Pavel
On Wed, Mar 4, 2009 at 8:15 PM, Nguyen Thai Ngoc Duy pclouds@gmail.com wrote:
Hi,
Can I use define-syntax without runtime option "-:s"? I tried the reference implemantation of SRFI-64 but it would not work without "-:s" because it uses define-syntax. But I don't want to lose Gambit-C specific features.
Thanks,
Duy _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On 3/5/09, Pavel Dudrenov dudrenov@gmail.com wrote:
hmm what gambit specific features are broken with -:s?
open-process
Also can't you: (load "~~lib/syntax-case") for whatever program needs syntax-case?
Won't work. I get ill-formed expression on define-syntax. Forgot to mention I'm using Gambit-C 4.4.1.
Really? That's odd. On mine it works fine. Here is an example with define-syntax straight from the gambit docs.
pavel@dudrenov:~$ gsi Gambit v4.4.1
(load "~~/lib/syntax-case")
"/usr/local/Gambit-C/lib/syntax-case.scm"
(define-syntax unless
(syntax-rules () ((unless test body ...) (if test #f (begin body ...)))))
(let ((test 111)) (unless (= 1 2) (list test test)))
(111 111)
On Wed, Mar 4, 2009 at 8:38 PM, Nguyen Thai Ngoc Duy pclouds@gmail.com wrote:
On 3/5/09, Pavel Dudrenov dudrenov@gmail.com wrote:
hmm what gambit specific features are broken with -:s?
open-process
Also can't you: (load "~~lib/syntax-case") for whatever program needs syntax-case?
Won't work. I get ill-formed expression on define-syntax. Forgot to mention I'm using Gambit-C 4.4.1. -- Duy
On 3/5/09, Pavel Dudrenov dudrenov@gmail.com wrote:
Really? That's odd. On mine it works fine. Here is an example with define-syntax straight from the gambit docs.
Umm... I tried again. It worked on REPL, but not from command line. Is there any difference between the two ways?
pclouds@dektop ~/w/chandai/tests $ gsi Gambit v4.4.1
(load "~~/lib/syntax-case")
"/usr/lib/syntax-case.scm"
(load "srfi-64")
"/home/pclouds/w/chandai/tests/srfi-64.scm"
*** EOF again to exit pclouds@dektop ~/w/chandai/tests $ gsi srfi-64 *** ERROR IN "srfi-64.scm"@95.1 -- Ill-formed expression
There is (load "~~/lib/syntax-case") near the top of srfi-64.scm.
pavel@dudrenov:~$ gsi Gambit v4.4.1
(load "~~/lib/syntax-case")
"/usr/local/Gambit-C/lib/syntax-case.scm"
(define-syntax unless
(syntax-rules () ((unless test body ...) (if test #f (begin body ...)))))
(let ((test 111)) (unless (= 1 2) (list test test)))
(111 111)
On Wed, Mar 4, 2009 at 8:38 PM, Nguyen Thai Ngoc Duy pclouds@gmail.com wrote:
On 3/5/09, Pavel Dudrenov dudrenov@gmail.com wrote:
hmm what gambit specific features are broken with -:s?
open-process
Also can't you: (load "~~lib/syntax-case") for whatever program needs syntax-case?
Won't work. I get ill-formed expression on define-syntax. Forgot to mention I'm using Gambit-C 4.4.1. -- Duy
The LOAD procedure doesn't execute until run-time. Macros are expanded before then. The command line parameter is meant to address this. It's essentially the same as doing:
gsi -e '(load "~~/lib/syntax-case")' file.scm
What is the problem you are having with the -:s option and open-process?
You might be able to get away with something like this:
(define-macro (load-at-expand-time name) (load name))
(load-at-expand-time "~~/lib/syntax-case")
On Mar 5, 2009, at 1:18 AM, Nguyen Thai Ngoc Duy wrote:
On 3/5/09, Pavel Dudrenov dudrenov@gmail.com wrote:
Really? That's odd. On mine it works fine. Here is an example with define-syntax straight from the gambit docs.
Umm... I tried again. It worked on REPL, but not from command line. Is there any difference between the two ways?
pclouds@dektop ~/w/chandai/tests $ gsi Gambit v4.4.1
(load "~~/lib/syntax-case")
"/usr/lib/syntax-case.scm"
(load "srfi-64")
"/home/pclouds/w/chandai/tests/srfi-64.scm"
*** EOF again to exit pclouds@dektop ~/w/chandai/tests $ gsi srfi-64 *** ERROR IN "srfi-64.scm"@95.1 -- Ill-formed expression
There is (load "~~/lib/syntax-case") near the top of srfi-64.scm.
pavel@dudrenov:~$ gsi Gambit v4.4.1
(load "~~/lib/syntax-case")
"/usr/local/Gambit-C/lib/syntax-case.scm"
(define-syntax unless
(syntax-rules () ((unless test body ...) (if test #f (begin body ...)))))
(let ((test 111)) (unless (= 1 2) (list test test)))
(111 111)
On Wed, Mar 4, 2009 at 8:38 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com
wrote: On 3/5/09, Pavel Dudrenov dudrenov@gmail.com wrote:
hmm what gambit specific features are broken with -:s?
open-process
Also can't you: (load "~~lib/syntax-case") for whatever program needs syntax-case?
Won't work. I get ill-formed expression on define-syntax. Forgot to mention I'm using Gambit-C 4.4.1. -- Duy
-- Duy _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On 3/5/09, James Long longster@gmail.com wrote:
The LOAD procedure doesn't execute until run-time. Macros are expanded before then. The command line parameter is meant to address this. It's essentially the same as doing:
gsi -e '(load "~~/lib/syntax-case")' file.scm
This works. Thanks, though the same way can't be applied for gsc (segfault).
What is the problem you are having with the -:s option and open-process?
It used to report error, something about open-process being unknown. I can not reproduce now though. Maybe it's my fault.
You might be able to get away with something like this:
(define-macro (load-at-expand-time name) (load name))
(load-at-expand-time "~~/lib/syntax-case")
This does not work.