Re: define-er-syntax* new egg
Added! Sorry that you had to ask four times, that sucks :( Cheers, Peter Arguably the first three times not coming through was a blessing in disguise since there weren't any releases in that file, it only had the first two lines 臘♀️
define-er-syntax* new egg
Can any one add https://idiomdrottning.org/define-er-syntax.release-info to egg-locations, please? I know that the last three times I asked, I forgot to actually put any releases in there. I found them in my fridge next to all the lettuce and pickle jars. Thank you♥
[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, 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
[Chicken-users] quoted vectors in syntax rules
I stumbled upon the following behavior: (equal? '#(a b c) (vector 'a 'b 'c)) (define (f-test) '#(a b c)) (define-syntax s-test (syntax-rules () ((test) '#(a b c (f-test) (s-test) (equal? (f-test) (s-test)) What is the explanation for this puzzle? Sandra ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] quoted vectors in syntax rules
On Fri, 2 Mar 2012 12:29:13 +0100, Peter Bex peter@xs4all.nl wrote: Try printing the result directly instead of comparing it. In 4.5.0, I get this: #;1 (define-syntax s-test (syntax-rules () ((test) '#(a b c #;2 (s-test) #(a30 b31 c32) Yes, that’s what I meant. Yeah, I’m still on 4.5.0 (I want to run the same version on both client and server). The easiest solution is to upgrade. I found two workarounds. One was to define a variable containing the quoted vector, the other was to use quasiquotation and call vector explicitly. I just wanted to let you guys know but it seems to be well known. Thanks anyway! Sandra ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users