hi
anyone get schelog working with gambit-c? I've tried both schelog.scm and gambit-schelog.scm, both versions get me: *** ERROR -- Ill-formed expression
if anyone has managed to get it working please let me know. thanks. I will see if I can get in touch with the author.
Afficher les réponses par date
On Aug 21, 2007, at 8:16 PM, naruto canada wrote:
anyone get schelog working with gambit-c? I've tried both schelog.scm and gambit-schelog.scm, both versions get me: *** ERROR -- Ill-formed expression
Your reports of the error messages you get are out of context and not very useful.
if anyone has managed to get it working please let me know. thanks.
You can download a version you can compile and that will work from
http://www.math.purdue.edu/~lucier/software/schelog/
(which you can get to from my home page if necessary). I had to fix makeport.scm because the getenv in recent gambit betas is different from getenv in older betas.
You build Schelog by:
[brad:~/Desktop/schelog] lucier% gsi makeport What is your Scheme dialect? [bigloo gambit guile mitscheme mzscheme petite pscheme scm stk] gambit Porting schelog.scm... Resulting file is `gambit-unix-version-of-schelog.scm' You may want to rename it
I compiled it with
[brad:~/Desktop/schelog] lucier% gsc gambit-unix-version-of- schelog.scm
I then cd'ed to the examples directory and ran the houses puzzle:
[brad:~/Desktop/schelog/examples] lucier% gsc Gambit Version 4.0 beta 23
(load "../gambit-unix-version-of-schelog")
"/Users/lucier/Desktop/schelog/examples/../gambit-unix-version-of- schelog.o1"
(load "houses.scm")
"/Users/lucier/Desktop/schelog/examples/houses.scm"
(load "puzzle.scm")
"/Users/lucier/Desktop/schelog/examples/puzzle.scm"
(solve-puzzle %houses)
((solution= ((japan owns the zebra) (norway drinks water))))
So it seems to work.
I will see if I can get in touch with the author.
I think Dorai has moved on to other things; he may not be interested in supporting it any more.
Brad
On 8/22/07, Bradley Lucier lucier@math.purdue.edu wrote:
On Aug 21, 2007, at 8:16 PM, naruto canada wrote:
anyone get schelog working with gambit-c? I've tried both schelog.scm and gambit-schelog.scm, both versions get me: *** ERROR -- Ill-formed expression
Your reports of the error messages you get are out of context and not very useful.
This is what I did, I simply copy the two files to my working dir, and then
(if (equal? "gambit-c" interpreter) (set! void (load "gambit-schelog.scm")) (set! void (load "schelog.scm")) ) (%which () %true)
I get: *** ERROR -- Ill-formed expression ()
It seems to return the correct answer "()", but still shows an error message-- strange.
if anyone has managed to get it working please let me know. thanks.
You can download a version you can compile and that will work from
http://www.math.purdue.edu/~lucier/software/schelog/
(which you can get to from my home page if necessary). I had to fix makeport.scm because the getenv in recent gambit betas is different from getenv in older betas.
You build Schelog by:
[brad:~/Desktop/schelog] lucier% gsi makeport
Thanks, it works now, this is what I did. first, "makeport" couldn't detect my OS, so I modify it:
;(set! *operating-system* ; (case *dialect* ; ((bigloo gambit guile mzscheme petite scm stk) ; (cond ((getenv "COMSPEC") 'windows) ; (else 'unix))) ; ((mitscheme) ; (cond ((get-environment-variable "COMSPEC") 'windows) ; (else 'unix))) ; ((pscheme) 'windows) ; (else ; (display "What is your operating system? [unix windows]") ; (newline) ; (read)))) (set! *operating-system* 'unix)
ok, now makeport works, /usr/4.0b22/bin/gsc gambit-unix-version-of-schelog.scm
/usr/4.0b22/bin/gsi Gambit Version 4.0 beta 22
(load "gambit-unix-version-of-schelog")
(%which () %true) (%which () %fail)
What is your Scheme dialect? [bigloo gambit guile mitscheme mzscheme petite pscheme scm stk] gambit Porting schelog.scm... Resulting file is `gambit-unix-version-of-schelog.scm' You may want to rename it
I compiled it with
[brad:~/Desktop/schelog] lucier% gsc gambit-unix-version-of- schelog.scm
I then cd'ed to the examples directory and ran the houses puzzle:
[brad:~/Desktop/schelog/examples] lucier% gsc Gambit Version 4.0 beta 23
(load "../gambit-unix-version-of-schelog")
"/Users/lucier/Desktop/schelog/examples/../gambit-unix-version-of- schelog.o1"
(load "houses.scm")
"/Users/lucier/Desktop/schelog/examples/houses.scm"
(load "puzzle.scm")
"/Users/lucier/Desktop/schelog/examples/puzzle.scm"
(solve-puzzle %houses)
((solution= ((japan owns the zebra) (norway drinks water))))
So it seems to work.
I will see if I can get in touch with the author.
I think Dorai has moved on to other things; he may not be interested in supporting it any more.
Brad
On Aug 21, 2007, at 10:08 PM, naruto canada wrote:
(%which () %true)
I get: *** ERROR -- Ill-formed expression ()
You need a quote to denote the empty list: '()
Just two parentheses by themselves is a syntax error in scheme; it's a function call but without a function name.
Unfortunately, several scheme implementations accept it as an extension to mean the empty list and so it gets propagated to scheme sources throughout the internets ...
Thanks, it works now, this is what I did. first, "makeport" couldn't detect my OS, so I modify it:
;(set! *operating-system* ; (case *dialect* ; ((bigloo gambit guile mzscheme petite scm stk) ; (cond ((getenv "COMSPEC") 'windows) ; (else 'unix))) ; ((mitscheme) ; (cond ((get-environment-variable "COMSPEC") 'windows) ; (else 'unix))) ; ((pscheme) 'windows) ; (else ; (display "What is your operating system? [unix windows]") ; (newline) ; (read)))) (set! *operating-system* 'unix)
I changed makeport.scm to do
(set! *operating-system* (case *dialect* ((gambit) (if (getenv "COMSPEC" #f) 'windows 'unix)) ((bigloo guile mzscheme petite scm stk) (cond ((getenv "COMSPEC") 'windows) (else 'unix))) ((mitscheme) (cond ((get-environment-variable "COMSPEC") 'windows) (else 'unix))) ((pscheme) 'windows) (else (display "What is your operating system? [unix windows]") (newline) (read))))
I understand the importance of different implementations of the same language having the same semantics, but are there any reasons why it would be a bad thing to create a language , suspiciously similar to scheme, where () is self evaluating?
On 8/21/07, Bradley Lucier lucier@math.purdue.edu wrote:
On Aug 21, 2007, at 10:08 PM, naruto canada wrote:
(%which () %true)
I get: *** ERROR -- Ill-formed expression ()
You need a quote to denote the empty list: '()
Just two parentheses by themselves is a syntax error in scheme; it's a function call but without a function name.
Unfortunately, several scheme implementations accept it as an extension to mean the empty list and so it gets propagated to scheme sources throughout the internets ...
Thanks, it works now, this is what I did. first, "makeport" couldn't detect my OS, so I modify it:
;(set! *operating-system* ; (case *dialect* ; ((bigloo gambit guile mzscheme petite scm stk) ; (cond ((getenv "COMSPEC") 'windows) ; (else 'unix))) ; ((mitscheme) ; (cond ((get-environment-variable "COMSPEC") 'windows) ; (else 'unix))) ; ((pscheme) 'windows) ; (else ; (display "What is your operating system? [unix windows]") ; (newline) ; (read)))) (set! *operating-system* 'unix)
I changed makeport.scm to do
(set! *operating-system* (case *dialect* ((gambit) (if (getenv "COMSPEC" #f) 'windows 'unix)) ((bigloo guile mzscheme petite scm stk) (cond ((getenv "COMSPEC") 'windows) (else 'unix))) ((mitscheme) (cond ((get-environment-variable "COMSPEC") 'windows) (else 'unix))) ((pscheme) 'windows) (else (display "What is your operating system? [unix windows]") (newline) (read))))
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On Aug 23, 2007, at 6:26 PM, |/|/ Bendick wrote:
I understand the importance of different implementations of the same language having the same semantics, but are there any reasons why it would be a bad thing to create a language , suspiciously similar to scheme, where () is self evaluating?
I don't care one way or the other whether () is self-evaluating in Scheme.
I don't *particularly* care whether the evaluation order of arguments in a function application is unspecified or left-to-right. [1]
Gambit follows the standard in both cases; I guess I've been debugging other people's nonstandard, broken code on Gambit for enough years now that I don't appreciate code that relies on the "helpful" language extensions by some implementations of self- evaluating () and fixed left-to-right argument evaluations.
By the way, R5.97RS keeps both of these R5RS rules.
Brad
[1] The current rule that the order can be different for each (dynamic) function application appeals to me somewhat for its beauty, and I also find it interesting that at one time each time you rebuilt Gambit from Scheme sources the compiler or interpreter (I don't remember which) switched from left-to-right to right-to-left evaluation of arguments in a function application; this may still be true.
i'm just starting with scheme and, personally, i learn through making mistakes. so i, at least, would prefer a language that is consistent to one that changes semantics for odd corner cases.
andrew
I understand the importance of different implementations of the same language having the same semantics, but are there any reasons why it would be a bad thing to create a language , suspiciously similar to scheme, where () is self evaluating?
On 8/21/07, Bradley Lucier lucier@math.purdue.edu wrote:
On Aug 21, 2007, at 10:08 PM, naruto canada wrote:
(%which () %true)
I get: *** ERROR -- Ill-formed expression ()
You need a quote to denote the empty list: '()
Just two parentheses by themselves is a syntax error in scheme; it's a function call but without a function name.
Unfortunately, several scheme implementations accept it as an extension to mean the empty list and so it gets propagated to scheme sources throughout the internets ...
Thanks, it works now, this is what I did. first, "makeport" couldn't detect my OS, so I modify it:
;(set! *operating-system* ; (case *dialect* ; ((bigloo gambit guile mzscheme petite scm stk) ; (cond ((getenv "COMSPEC") 'windows) ; (else 'unix))) ; ((mitscheme) ; (cond ((get-environment-variable "COMSPEC") 'windows) ; (else 'unix))) ; ((pscheme) 'windows) ; (else ; (display "What is your operating system? [unix windows]") ; (newline) ; (read)))) (set! *operating-system* 'unix)
I changed makeport.scm to do
(set! *operating-system* (case *dialect* ((gambit) (if (getenv "COMSPEC" #f) 'windows 'unix)) ((bigloo guile mzscheme petite scm stk) (cond ((getenv "COMSPEC") 'windows) (else 'unix))) ((mitscheme) (cond ((get-environment-variable "COMSPEC") 'windows) (else 'unix))) ((pscheme) 'windows) (else (display "What is your operating system? [unix windows]") (newline) (read))))
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
-- |/|/ Bendick _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On 8/24/07, andrew cooke andrew@acooke.org wrote:
i'm just starting with scheme and, personally, i learn through making mistakes. so i, at least, would prefer a language that is consistent to one that changes semantics for odd corner cases.
I concur. I don't mind putting an extra quote for null. The less rules one has to maintain for an interpreter the better. It's easier to update an existing package then to put in extra rules for the language.
andrew
I understand the importance of different implementations of the same language having the same semantics, but are there any reasons why it would be a bad thing to create a language , suspiciously similar to scheme, where () is self evaluating?
On 8/21/07, Bradley Lucier lucier@math.purdue.edu wrote:
On Aug 21, 2007, at 10:08 PM, naruto canada wrote:
(%which () %true)
I get: *** ERROR -- Ill-formed expression ()
You need a quote to denote the empty list: '()
Just two parentheses by themselves is a syntax error in scheme; it's a function call but without a function name.
Unfortunately, several scheme implementations accept it as an extension to mean the empty list and so it gets propagated to scheme sources throughout the internets ...
Thanks, it works now, this is what I did. first, "makeport" couldn't detect my OS, so I modify it:
;(set! *operating-system* ; (case *dialect* ; ((bigloo gambit guile mzscheme petite scm stk) ; (cond ((getenv "COMSPEC") 'windows) ; (else 'unix))) ; ((mitscheme) ; (cond ((get-environment-variable "COMSPEC") 'windows) ; (else 'unix))) ; ((pscheme) 'windows) ; (else ; (display "What is your operating system? [unix windows]") ; (newline) ; (read)))) (set! *operating-system* 'unix)
I changed makeport.scm to do
(set! *operating-system* (case *dialect* ((gambit) (if (getenv "COMSPEC" #f) 'windows 'unix)) ((bigloo guile mzscheme petite scm stk) (cond ((getenv "COMSPEC") 'windows) (else 'unix))) ((mitscheme) (cond ((get-environment-variable "COMSPEC") 'windows) (else 'unix))) ((pscheme) 'windows) (else (display "What is your operating system? [unix windows]") (newline) (read))))
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
-- |/|/ Bendick _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
|/|/ Bendick wrote:
I understand the importance of different implementations of the same language having the same semantics, but are there any reasons why it would be a bad thing to create a language , suspiciously similar to scheme, where () is self evaluating?
For the record, here's Common Lisp's behaviour (at least how SBCL 0.8.16 works):
* () NIL * nil NIL * '(a b c) (A B C) * '(a b nil) (A B NIL) * '(a b ()) (A B NIL) * '(a b . nil) (A B)
I guess the Schemes which make () self quoting do this mainly for people coming from CL.
But I think requiring the user to quote it is fine. It's making for consistent list handling, and cases where you open a pair of parens in Emacs, and then forget to fill something in, will be trapped as error.
(I'm coming from Perl but I *like* that Scheme is explicit in such things (also for example the explicit string/number/boolean types).)
That said, this is an example where you could add a rule to a module processor to interpret code which relies on self-quoting () on an evaluation/compilation engine which doesn't allow those. I'll do it, promised (may take some time still).
Christian.