Re: [Chicken-users] 4.8.0.5 syntax weirdness
On Mon, Mar 10, 2014 at 11:22:53PM -0500, Jim Ursetto wrote: This is the fix: commit f8230a466ce3a86f360178f115fb62ee124448b9 Author: Peter Bex peter@xs4all.nl Date: Sun Jun 30 18:50:09 2013 +0200 Fix meta-evaluation to actually take place in the meta environment and add tests Signed-off-by: Christian Kellermann ck...@pestilenz.org It seems pretty simple and applies cleanly to stability and tests out ok. Do you think I should apply it? Thanks for checking that, Jim! Considering we have a few other post-4.8.0.5 patches, it might be worth tagging a 4.8.0.6 release. That will be quicker than waiting for the two remaining patches, starting the release cycle with release candidates, having periods of testing etc. Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] 4.8.0.5 syntax weirdness
Ok. May not be able to make a full release for a few days but will push out the change Wednesday, at least. On Mar 11, 2014, at 2:31, Peter Bex peter@xs4all.nl wrote: On Mon, Mar 10, 2014 at 11:22:53PM -0500, Jim Ursetto wrote: This is the fix: commit f8230a466ce3a86f360178f115fb62ee124448b9 Author: Peter Bex peter@xs4all.nl Date: Sun Jun 30 18:50:09 2013 +0200 Fix meta-evaluation to actually take place in the meta environment and add tests Signed-off-by: Christian Kellermann ck...@pestilenz.org It seems pretty simple and applies cleanly to stability and tests out ok. Do you think I should apply it? Thanks for checking that, Jim! Considering we have a few other post-4.8.0.5 patches, it might be worth tagging a 4.8.0.6 release. That will be quicker than waiting for the two remaining patches, starting the release cycle with release candidates, having periods of testing etc. Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] 4.8.0.5 syntax weirdness
Dear chicken-users; I have a simple program that does most of its heavy lifting at compile time. To demonstrate the issue, I've written two stubs (as simple as I could make them but still show the issue I'm having). File number one is called ticket-stub.scm: -8 (use s (srfi 1)) (define-syntax create-tickets (ir-macro-transformer (lambda (f i c) `(list ,@(filter-map (lambda (x) (if (s-contains? enemy- x) #f (s-prepend friendly- x))) cells) (print (first (create-tickets))) -8 It should print out the word friendly-horse after this: csc -extend ticket-stub-compilation.scm ticket-stub.scm ./ticket_stub Here is its sister file, ticket-stub-compilation.scm: -8 (use s (srfi 1) anaphora) (define (gen-cells) ;; In the real version of this, this is not only an expensive ;; operation but it's also dependent on io and data that I only want ;; to read at compile time. (It's going through a large collection of ;; XML files and selecting a small subset of that for this program.) ;; For the purposes of this stub, it's simply some strings. (let ((n (random 10))) (if (zero? n) '() (cons (if (odd? n) enemy-horse horse) (gen-cells) (define cells (let big-cells ((cells (gen-cells))) (if ( (length cells) 3) cells (big-cells (gen-cells) -8 When compiled with this version of Chicken: CHICKEN (c) 2008-2013, The Chicken Team (c) 2000-2007, Felix L. Winkelmann Version 4.8.0.5 (stability/4.8.0) (rev 5bd53ac) linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ] compiled 2013-10-03 on aeryn.xorinia.dim (Darwin) I get this error: Error: during expansion of (create-tickets ...) - unbound variable: s-contains? followed by the call history, and then Error: shell command terminated with non-zero exit status 17920: '/usr/bin/chicken' 'ticket-stub.scm' -output-file 'ticket-stub.c' -extend ticket-stub-compilation.scm However, when compiled with this version of Chicken: CHICKEN (c)2008-2011 The Chicken Team (c)2000-2007 Felix L. Winkelmann Version 4.7.0 linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ] compiled 2011-09-05 on gladstone.duckburg.org (Linux) We get our friendly-horse. Am I doing something wrong or have I found a bug? (Weird that there’s an EOL space on the line “Version 4.7.0 ” but I guess that’s some Debian quirk.) 4.7.0 is the version that’s in Debian Stable. Sandra ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] 4.8.0.5 syntax weirdness
On Mon, Mar 10, 2014 at 01:26:08PM +0100, Sandra Snan wrote: Dear chicken-users; I have a simple program that does most of its heavy lifting at compile time. To demonstrate the issue, I've written two stubs (as simple as I could make them but still show the issue I'm having). File number one is called ticket-stub.scm: -8 (use s (srfi 1)) (define-syntax create-tickets (ir-macro-transformer (lambda (f i c) `(list ,@(filter-map (lambda (x) (if (s-contains? enemy- x) #f (s-prepend friendly- x))) cells) (print (first (create-tickets))) -8 Hello Sandra, The above program uses the procedures provided by the s egg at expansion time, so you need to load and import them at the syntax level: (begin-for-syntax (use s)) Or, in newer CHICKENs: (use-for-syntax s) The reason it worked with 4.7.0 and not with 4.8.0 is that this is really a bug: at compile time, procedures imported for runtime should not be available unless they're explicitly imported. That's the entry in 4.8.0's NEWS: Fixed a bug that caused imported identifiers to leak into the macroexpansion/compile-time environment Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] 4.8.0.5 syntax weirdness
On Mon, 10 Mar 2014 13:54:03 +0100, Peter Bex peter@xs4all.nl wrote: On Mon, Mar 10, 2014 at 01:26:08PM +0100, Sandra Snan wrote: Dear chicken-users; I have a simple program that does most of its heavy lifting at compile time. To demonstrate the issue, I've written two stubs (as simple as I could make them but still show the issue I'm having). (I realized after sending that one of the stubs could randomly generate a list without any “friendly” strings. The full program is deterministic, it just needs to trawl through a lot of data.) The above program uses the procedures provided by the s egg at expansion time, so you need to load and import them at the syntax level: Thank you so much, Peter. (begin-for-syntax (use s)) Unfortunately, this gives me “Error: unbound variable: use” Or, in newer CHICKENs: (use-for-syntax s) and this gives me “Error: unbound variable: use-for-syntax” Sandra ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] 4.8.0.5 syntax weirdness
I couldn't quite get this to work: ticket-stub.scm 8 (use s (srfi 1)) (begin-for-syntax (import chicken) (use s (srfi))) (define-syntax create-tickets (ir-macro-transformer (lambda (f i c) `(list ,@(filter-map (lambda (x) (if (s-contains? enemy- x) #f (s-prepend friendly- x))) cells) (print (first (create-tickets))) 8 ticket-stub-compilation.scm 8 (use s (srfi 1) anaphora) (define (gen-cells) ;; In the real version of this, this is not only an expensive ;; operation but it's also dependent on io and data that I only want ;; to read at compile time. ;; For the purposes of this stub, it's simply some strings. (let ((n (random 10))) (if (zero? n) '() (cons (if (odd? n) enemy-horse horse) (gen-cells) (define cells (cons horse (gen-cells))) 8 It still can't find s-contains. If I move the entire (define-syntax create-tickets ...) sexp to the end of begin-for-syntax, it can't find create-tickets when called later. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] 4.8.0.5 syntax weirdness
On Mon, Mar 10, 2014 at 07:37:36PM +0100, Sandra Snan wrote: I couldn't quite get this to work: It still can't find s-contains. If I move the entire (define-syntax create-tickets ...) sexp to the end of begin-for-syntax, it can't find create-tickets when called later. This is unfortunate: I just tested your code and it works with 4.8.4, but not with 4.8.0.5. Most likely this was a large change we considered too dangerous to include in the stability branch. I'm not sure which of the many changes it was that fixed this. I'm afraid your only options are to stick with 4.7.0 or use the 4.8.4 development snapshot (or git master) until 4.9.0 has been released. The good news is that both the development snapshot and master should be pretty stable since we're this close to a release. Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] 4.8.0.5 syntax weirdness
This is the fix: commit f8230a466ce3a86f360178f115fb62ee124448b9 Author: Peter Bex peter@xs4all.nl Date: Sun Jun 30 18:50:09 2013 +0200 Fix meta-evaluation to actually take place in the meta environment and add tests Signed-off-by: Christian Kellermann ck...@pestilenz.org It seems pretty simple and applies cleanly to stability and tests out ok. Do you think I should apply it? Jim On Mar 10, 2014, at 2:08 PM, Peter Bex peter@xs4all.nl wrote: On Mon, Mar 10, 2014 at 07:37:36PM +0100, Sandra Snan wrote: I couldn't quite get this to work: It still can't find s-contains. If I move the entire (define-syntax create-tickets ...) sexp to the end of begin-for-syntax, it can't find create-tickets when called later. This is unfortunate: I just tested your code and it works with 4.8.4, but not with 4.8.0.5. Most likely this was a large change we considered too dangerous to include in the stability branch. I'm not sure which of the many changes it was that fixed this. I'm afraid your only options are to stick with 4.7.0 or use the 4.8.4 development snapshot (or git master) until 4.9.0 has been released. The good news is that both the development snapshot and master should be pretty stable since we're this close to a release. Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users