[Chicken-users] Segfaults with shared library, foreign code
I'm trying to write bindings to the Clutter UI toolkit, but I'm hitting segfaults when building a shared library. I've essentialized the issue to the following code: http://gist.github.com/847871#file_clutter.scm The C is more or less copied pasted from the Clutter docs, and it compiles correctly both alone with gcc and in the above file with: $ csc clutter.scm -C `pkg-config --cflags clutter-1.0` -L `pkg-config --libs clutter-1.0` $ ./clutter [window opens, everything's good] But when I remove the invocation of (main) or wrap it in a module and try to build it as a shared library (with -s) it compiles fine but segfaults when loaded at an interpreter or in another .scm file: $ csc -s clutter.scm -C `pkg-config --cflags clutter-1.0` -L `pkg-config --libs clutter-1.0` $ csi clutter.so [...] #;1 (main) Segmentation fault Likewise, the following file using lazy-ffi has the same problem: http://gist.github.com/847871#file_clutter_lazy.scm FWIW it seems that removing any reference to clutter_text solves the problem, which might point to Clutter as the troublemaker, BUT both files above work perfectly on OS X with the same versions of both Chicken and Clutter, so I'm not sure. Also, removing the entrance of clutter_main (the GUI loop) doesn't help. I might just be missing some compilation flags but I'm pretty much in the dark. Any ideas? Evan ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Segfaults with shared library, foreign code
I've attached LD_DEBUG tails for all and libs as well as a gdb log, though at this point I'm fairly sure this is a Clutter issue. What's strange to me is that preloading the library works: $ LD_PRELOAD=`pwd`/clutter.so csi Admittedly I've no idea why that in particular should work or what that means in the context of Chicken's foreign interface. Thanks, Evan P.S. Thanks for the great platform. On Mon, Feb 28, 2011 at 4:37 PM, Felix fe...@call-with-current-continuation.org wrote: From: Evan Hanson vnh...@gmail.com Subject: [Chicken-users] Segfaults with shared library, foreign code Date: Mon, 28 Feb 2011 13:59:05 -0600 FWIW it seems that removing any reference to clutter_text solves the problem, which might point to Clutter as the troublemaker, BUT both files above work perfectly on OS X with the same versions of both Chicken and Clutter, so I'm not sure. Also, removing the entrance of clutter_main (the GUI loop) doesn't help. I might just be missing some compilation flags but I'm pretty much in the dark. Any ideas? Unfortunately not. Do the library loading and symbol-lookups work out? Please try running the example with LD_DEBUG to all or libs - perhaps the indirect use of the clutter libs can't be resolved. cheers, felix all.out Description: Binary data libs.out Description: Binary data gdb.log Description: Binary data ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] German Lisp Workshop at the CCC in Cologne
Chicken already has all the bindings to the core C I/O functions, so it might not be too much work to implement some minimal command-line history. -Ivan Keep in mind, though, that readline provides a lot more than just history (like completion, or my beloved vi mode...). Seems like a lot of functionality to reinvent IMO... Though perhaps editline or linenoise provide these? Evan ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Using csi within Vim to evaluate visually selected text
In case you haven't seen it already, there's a page on using Chicken with Vim on the wiki: http://wiki.call-cc.org/vim?action=show. It has some similar functionality there but I'm sure your contribution would be welcome there as well. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] where move-file is?
Hi Hugo, On 06/30/11 at 10:04am, Hugo Arregui wrote: I want to use move-file procedure, [...] but i cannot find it as an egg or as an procedure. Many file operations such as file-move and file-copy are in the files unit: http://wiki.call-cc.org/man/4/Unit%20files Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] define-for-syntax modules
It appears that modules either leak define-for-syntax bindings, or aren't meant to contain them. If the latter is the case, please ignore. However, this seems unintuitive. (module test () (import scheme chicken) (define-for-syntax + string-append)) $ csi -nq #;1 (use test) ; loading ./test.import.scm ... ; loading /usr/lib/chicken/6/scheme.import.so ... ; loading /usr/lib/chicken/6/chicken.import.so ... ; loading ./test.so ... #;2 (+ a b c) abc #;3 I found a note on import-for-syntax in the manual which looks like it might refer to the same issue, but I'm not certain. In any case, I thought I'd bring it up in case this is a bug, or if there's something I'm missing. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Chicken on Heroku
A few days ago I put together a buildpack that allows one to run Chicken apps on Heroku; figured I'd share it here in case someone else finds it useful. A buildpack, for the tragically unhip, is just a handful of scripts to bootstrap an environment for a Heroku process. This one installs Chicken 4.7.0 and runs a standard chicken-install for your program -- apps can be written just like eggs, with setup- and meta-files per usual. Defining a default command to run once everything is installed is the only weird part; Heroku uses a file called a Procfile[1] to specify processes, which you can use to start e.g. an awful app on the correct port for the instance: web: awful --port=$PORT example.scm If no Procfile is present, the buildpack will try to run a file called `run.scm` in your application's root. This may or may not be a good default -- I'm open to suggestions. chickadee, pastiche and the handful of awful apps that I tried worked without any real configuration; there's an example in the README. The repository is located here: https://github.com/evhan/heroku-buildpack-chicken Hopefully this'll help someone get some hot Chicken-on-cloud action... Cheers, Evan [1]: https://devcenter.heroku.com/articles/procfile ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Interpreter with FFI extension
On 2013/02/06 12:43P, Ivan Filgueiras wrote: I'm really new to chicken and I was wondering if there is a way to use FFI C functions (maybe with 'bind') with the csi interpreter, so that I can dynamically experiment with C stuff. If you have libffi, the lazy-ffi egg provides an easy way to experiment with foreign libraries from the REPL. http://wiki.call-cc.org/eggref/4/lazy-ffi Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] ANN: persistent-hash-map 0.0.1
Fellow Chickeneers, [... snip great write-up... ] Cheers all around Moritz This looks really useful, thanks Moritz. And also, thanks for the write-up about the library -- it's nice to have an idea of the motivation behind it, and the other tips (Chicken/performance-related) are helpful as well. Taking the time to do that is much appreciated. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Unit testing of non-exported procedures
Hi Matt, A simple solution might be to keep your implementation in one file and your module form in another that includes it. Then, your tests could `include` or `load-relative` or whatever the implementation file rather than the module, making all its definitions visible. This may not work for your situation, but it's straightforward if you'll always be testing with the source present. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Spiffy subprocess cleanup
Hi Bryan, I tried to paste a response but missed you in #chicken. I think you need to make sure to close the ports returned by process* (in your paste, the close-input/output-port forms aren't running since process* is signaling an error): http://paste.call-cc.org/paste?id=76432a008b2c4310d0044e91d4bcf48c74b730d8#a1 You can register an exception handler for spiffy to make it more clear what/when things are going wrong: http://api.call-cc.org/doc/spiffy#def:handle-exception Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Spiffy subprocess cleanup
After looking at a bit more, here's what I believe is *actually* happening: The invalid call to process* is signaling an exception in the child, which is handled internally by spiffy (spiffy.scm:470), causing that process to loop back to the start of the accept-next-connection procedure inside spiffy's accept-loop. At this point you have two processes listening on 8080, with the parent waiting for the child (who has no plans to exit). The same thing happens with each request, so the subprocesses pile up. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] define rec
I don't think this is specific to `rec`, but is simply the way CHICKEN handles syntax, e.g. #;1 (define when list) #;2 (when 1 2) 2 #;3 (define-syntax user-when (syntax-rules () ((_ a b . c) (if a (begin b . c) #;4 (define user-when list) #;5 (user-when 1 2) 2 I'd guess this is a big thing to change. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] dynamic scoping
Have a look at parameter objects. http://api.call-cc.org/doc/chicken/parameters Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Questions/nitpicks about Posix I/O
On 06/09/13 16:48, Matt Gushee wrote: I need to open an output file in append mode. Since none of the high-level I/O functions appear to allow this, it seems I need to use the posix library. Without digging any further, I'd point out that `with-output-to-file` et al. also accept #:append (as with `open-output-file`, which you mention but don't use in your example), since this is something really handy that I wasn't aware of for a long time. So, maybe your problem is solved by simply doing the following? (with-output-to-file somefile.txt (lambda () (display some-text)) #:append) I agree with the rest of your email re: the posix API. I usually have to trawl mailing list for examples whenever I need to do anything involving fds or pipes. 1-4 and 7-9 all seem like the ideal behavior to me. 5 is confusing, and I agree that it should be an error (as in 4). On my machine, 6 is only true until you flush or close the second port, at which point its output is produced. I don't think this should be an error. Regarding names, at first glance `fileno-output-port` seems more clear to me than `open-output-file*`, although neither name really helps to signal any of the limitations you listed. However, you say that... [open-output-file*] does nothing to change the state of the file object, it simply makes it available for high-level output procedures. ... But that's only true until you close that port, at which point it *does* change the fd (since no more ports may be opened for it). To me, it would be ideal if closing that fd was delayed until all associated ports were also closed, but that may be hard/impossible/stupid for some reason. More generally, I find it easier to avoid opening more than one output port for a given fd, and instead use higher level code to manage IO on that one port (with custom/broadcast/concatenated ports, etc. for fancier stuff). This skips most of the posix API altogether, and avoids a lot of the issues you listed (hopefully... YMMV). Perhaps this pattern could/should be enforced in the posix unit itself, by simply disallowing multiple calls to `open-output-file*`s on a single fd? Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Changing string representation for records
Hi Chris, On 2013-09-22 23:58, Chris Mueller wrote: Is there any possibility to specify the string output for this record instance? Take a look at `define-record-printer` (http://api.call-cc.org/doc/chicken/special-forms/define-record-printer), e.g. (define-record-printer matrix (lambda (m port) (fprintf port #matrix ~ax~a (matrix-rows m) (matrix-cols m Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Unix Scripting in Chicken
Hi Danny, SCSH was made for just this, and Peter has ported much of it to CHICKEN -- have a look at the scsh-process egg: http://wiki.call-cc.org/eggref/4/scsh-process Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Redefinition of imported binding gets implicitly exported
Hi Andy, all. I looked into this recently since it also seemed like a bug to me, but the behavior seems to be intentional judging from the code. A workaround is to exclude `process` from the import list in `m` (as in `(import (except posix ...))`) -- this prevents the behavior you're seeing, at least. When `##sys#alias-global-hook` is used to resolve an identifier name for an assignment, it's called with the already-looked-up name from the environment and shortcuts when that identifier is already aliased, returning the imported name (in this case, the built-in `process`) rather than a new, module-prefixed identifier that would shadow the binding like you said. It seems to me that when `##sys#alias-global-hook` is used to resolve names for `set!` forms, it should be called with the bare (pre-se-lookup) identifier, and when `assign` is true and you're currently in a module it should always create a module-prefixed identifier and update the environment, instead of returning the existing alias for imported symbols. But, I couldn't get this to work without breaking other things. CC'ing -hackers. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Problem with read-line
Hi Dan, `read-line` is provided by the extras unit, which is implicitly available in csi but not so in compiled code. To load it, try adding a (use extras) to your program. (Obviously, also let us know if this doesn't work.) Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] foreign-lambda declaration for char**?
Hi Alyn, On 09/12/13 06:29, .alyn.post. wrote: What is the magic phrase to tell foreign-lambda a parameter is a char**? `(c-pointer c-string)` or `(c-pointer nonnull-c-string)` should do it. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] assigning scheme object to foreign pointer
Hi Pluijzer, On 16/12/13 12:59, pluijzer wrote: I am using a C-library that lets you assign user data to objects via a void pointer. I would like to assign a scheme object to this pointer, but as I understand I cannot use 'object-pointer' for this, as the garbage collector might move the object. There are a couple of ways to do this. One is to manually move the object into static memory, via `object-evict` (http://api.call-cc.org/doc/lolevel#def:object-evict). This is nice and easy, but might not work as expected for all data types. Another is to create a new GC root for the object, via `CHICKEN_new_gc_root` and its associated procedures (http://api.call-cc.org/doc/foreign/embedding#sec:CHICKEN_new_gc_root). You might also sidestep the issue entirely by keeping your objects in a Scheme-side lookup table and only storing immediate values in the pointer that you can then use to retrieve the objects as needed. Other folks may chime in with more ideas, but I hope these help some. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Wiki design
On 19/12/13 08:41, Peter Bex wrote: Right now my main laptop is unusable so I'm on an older iBook, where the resolution is kind of low. Due to the small screen size the search boxes overlap with the menu tabs. I imagine the same happens on those fancy new tablet thingies as well. Same here. Finally, the matching paren highlighting thing in the source snippet goes haywire when I hover over some code: it overlines everything here. I guess the text height is slightly different from the surrounding spans or something like that. I have also noticed this, but it was always in a Firefox that's fairly well-stocked with RequestPolicy/NoScript-type addons, so I always chalked it up those. However, I notice now that even when disabling all of these it still happens. Firefox only here; it doesn't happen in Chromium or Opera. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Wiki design
On 2013-12-19 8:49, Evan Hanson wrote: On 19/12/13 08:41, Peter Bex wrote: Finally, the matching paren highlighting thing in the source snippet goes haywire when I hover over some code: it overlines everything here. I guess the text height is slightly different from the surrounding spans or something like that. I have also noticed this, but it was always in a Firefox that's fairly well-stocked with RequestPolicy/NoScript-type addons, so I always chalked it up those. However, I notice now that even when disabling all of these it still happens. Firefox only here; it doesn't happen in Chromium or Opera. I should have clarified: this currently happens on the actual wiki for me, as well. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Wiki design
On 2013-12-18 21:28, Peter Bex wrote: On Thu, Dec 19, 2013 at 09:17:48AM +1300, Evan Hanson wrote: On 2013-12-19 8:49, Evan Hanson wrote: On 19/12/13 08:41, Peter Bex wrote: Finally, the matching paren highlighting thing in the source snippet goes haywire when I hover over some code: it overlines everything here. I guess the text height is slightly different from the surrounding spans or something like that. I have also noticed this, but it was always in a Firefox that's fairly well-stocked with RequestPolicy/NoScript-type addons, so I always chalked it up those. However, I notice now that even when disabling all of these it still happens. Firefox only here; it doesn't happen in Chromium or Opera. I should have clarified: this currently happens on the actual wiki for me, as well. What's your resolution? I'm also using Firefox (Iceweasel) with NoScript on my iBook, at a resolution of 1024x768 (don't laugh, please) and I *don't* get any overlaps on the live wiki. The search boxes are neatly inside the white main part of the page, below the menu tabs which protrude above the main box. Also Iceweasel, 1366x768 and 1600x900, it happens with both. This is just for the paren highlighting (the 1px overline) -- the search boxes look right, as you describe, on the live wiki. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Wiki design
On 2013-12-19 20:27, Arthur Maciel wrote: Well, I would appreciate another try. https://dl.dropboxusercontent.com/u/621606/chicken-wiki.tar.gz Best wishes and thank you all for support! This one is really nice. The paren issue is gone now, and I like the look of the search section (I might bump it a bit further to the left, though -- it hangs slightly over the right edge for me in Firefox: http://foldling.org/~evhan/tmp/wiki-search.png). Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] [ANN] FUSE interface
There is now a FUSE[1] interface available: http://wiki.call-cc.org/egg/fuse It's been only lightly tested so far, so I'd appreciate hearing about any issues people have with it, especially troubles installing or running the examples. Happy holidays, Evan [1]: http://fuse.sourceforge.net/ ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] [ANN] FUSE interface
Hi richo, On 2013-12-24 14:36, richo wrote: Have you done any benchmarking or profiling against other high level wrappers around fuse? Nothing remotely scientific, just casual checks against fuse-python to make sure there isn't an obvious problem hanging out at the surface. The egg is comparable to the multithreaded version of that wrapper on hello world-alikes and stat(2) in a loop, at least :). Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] [ANN] FUSE interface
On 2013-12-28 11:42, Evan Hanson wrote: On 2013-12-24 14:36, richo wrote: Have you done any benchmarking or profiling against other high level wrappers around fuse? The egg is comparable to the multithreaded version of that wrapper After writing this, I got to thinking that that seemed a bit slow. Then I realized all my testing was done on a debug build of CHICKEN; similarly superficial examples on a stock CHICKEN are around 3 times as fast, so that's a little better. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] no type error calling |append!|
Hi Alan, On 2014-01-05 18:18, Alan Post wrote: $ csi -n #;1 (use srfi-1) #;2 (append! foo bar '()) () This isn't actually types.db at work, but the runtime checks (or lack thereof) in `append!`. With the scrutinizer, you'd see something like: $ csc foo.scm Warning: at toplevel: (foo.scm:1) in procedure call to `append!', expected argument #1 of type `list', but was given an argument of type `string'. So types.db will help if you heed its warnings when compiling, but the way `append!` is written it'll happily ignore any non-pair arguments you give it (which I agree is strange, but I don't know if it should be changed; others may). Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Patch for FreeBSD link error
Hi Jules, (Patch CC'd to -hackers.) On 2014-01-05 15:45, J Altfas wrote: That message looked awfully familiar! Sure enough, the issue had been discussed in this list in Feb 2013. At the time jcowan suggested there was a bug in clang: it didn't handle the -R and -z parameters in the same invocation. Looking into it, in fact the bug is in CHICKEN. Turns out the -z flag is really a linker vs. compiler flag, so the -z origin incantation needs to be passed to the linker. Here's a patch that fixes the problem: Thanks for reporting this (again!). I was able to duplicate it, and it seems -z should indeed be passed as a linker flag; attached is a `git am`-formatted patch that fixes the issue (it actually implements Vitaly Magerya's suggested fix from the original thread[1]). I don't see a reason this shouldn't have been added after that first discussion, but I think it's probably just because a patch never bubbled up up anywhere, so thank you. [1]: https://lists.gnu.org/archive/html/chicken-users/2013-02/msg00085.html Cheers, Evan From a45641a85c6ffed4a5ed975fc437c21113c1e6dc Mon Sep 17 00:00:00 2001 From: Evan Hanson ev...@foldling.org Date: Fri, 17 Jan 2014 14:30:59 +1300 Subject: [PATCH] Pass -z origin as a linker option for deployed binaries on FreeBSD Thanks to Jules Altfas and Vitaly Magerya for the report and suggested fix. --- NEWS|4 csc.scm |2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 7592ce4..4e89a4e 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,10 @@ - The procedure trace buffer has been made resizable. - C_zap_strings and ##sys#zap-strings (undocumented) have been deprecated. +- Tools + - csc: -z origin is now passed as a linker option on FreeBSD when +compiling for deployment (thanks to Jules Altfas Vitaly Magerya) + - Core libraries - Unit extras now implicitly depends on ports. ports no longer implicitly depends on extras. This may break programs which don't diff --git a/csc.scm b/csc.scm index 74d1d8b..935687f 100644 --- a/csc.scm +++ b/csc.scm @@ -277,7 +277,7 @@ (else (list (conc -L\ library-dir \ (if (and deployed (eq? (software-version) 'freebsd)) - (list -z origin) + (list -Wl,-z,origin) '()) (cond ((get-environment-variable CHICKEN_C_LIBRARY_PATH) = (lambda (path) -- 1.7.10.4 ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] combining syntax-rules and er/ir-macro
Hi Alyn, On 2014-01-29 18:07, .alyn.post. wrote: Why is %map not visible inside enum? In order to make `%map` available to the enum transformer, it needs to be defined at expansion time, e.g. (this is one way, there may be others): (begin-for-syntax (define-syntax %map (syntax.rules () ...))) Also note that because `enum` is an ir transformer, the form provided to it will already have been renamed, so as it stands it will most likely define something like my-foo123 rather than my-foo -- you'll probably have to `inject` those parts of the form in order to have the correct identifiers bound as a result /possibly unwelcome observation. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Matchable not working in module
On 05/03/14 16:39, Matt Gushee wrote: However, I'm now getting a compile error like this: : Warning: reference to possibly unbound identifier `ofs' in: : Warning:failure527 : Error: module unresolved: cav-web-fcgi I am using 'match' from the matchable egg to dispatch requests, like this: : (match spec : [(or ((/ ) GET #f) ((/ articles) GET #f)) : (send-html (get-article-list-page/html out: #f))] : [(or ((/ ) GET #f) ((/ articles) GET ofs)) : (send-html (get-article-list-page/html out: #f offset: (string-number ofs)))] ... and so on. So 'ofs' is a variable in the pattern match. `ofs` is only present in the second arm of the `(or ...)` pattern, so I'm guessing this is due `ofs` being unbound in the expansion of the first alternative. It's as if you had said: (match a ((or #f x) x)) ... Which will hopefully signal a similar error (hopefully -- untested!). This probably only worked before due to the forgiving nature of the top level (which is hopeless, and so on). Anyway, try refactoring the `match` clause to bind `ofs` in all cases and see if that helps. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Question about set-car! and set-cdr!
On 07/03/14 09:03, Daniel Carrera wrote: I am not experienced with reading RnRS standards, but my impression is that R7RS does not require that set-car! and set-cdr! be moved to a separate library. Indeed it does not (i.e. they are provided the (scheme base) library (as well as (scheme r5rs))). Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] LevelDB bindings
Hi Caolan, and welcome :) Thanks for making this egg -- based on the README it looks very nice to use/well thought-out. One note: chicken-install expects the tests directory to be named tests, but your project has it under test instead. If that's not intentional you may want to rename it so your egg will run its tests when asked and benefit from salmonella's regular test runs. Let us know if you'd like to fix this before it's added to the coop. Otherwise, it installs/tests OK here. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] LevelDB bindings
On 2014-04-20 14:33, Caolan McMahon wrote: Thanks Evan, I've renamed the directory to 'tests'. Salmonella still complains about missing docs, not sure how to fix that. salmonella checks the wiki for documentation, so that'll be fixed by creating http://wiki.call-cc.org/egg/leveldb. Anyway, I've added leveldb.release-info to the list and your egg should be available shortly. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] 4.9.0rc1: Error: (assv) bad argument type: null
Hi Andy, The error on 4.9.0rc1 is likely due to 0a52536, which made `assoc`, `member` et al. signal errors when their second arguments aren't lists instead of just returning #f (or the sentinel value). This is new behavior since 4.7.0, and IIRC there were a couple of places in CHICKEN itself that required updating after this change too, since they were also relying on these cases returning #f. Anyway, when passed `eqv?` as a comparator *before* importing numbers, `alist-ref` uses CHICKEN's built-in `assq` for the search, including this new behavior. *After* importing numbers, however, you're really passing the numbers extension's version of `eqv?`, which `alist-ref` doesn't take as a signal to use the built-in `assq` and instead falls back to a search function that matches the pre-0a52536 (i.e. 4.7.0) behavior and returns #f/the sentinel value. @ -hackers: I think `alist-ref`'s fallback search function should match the behavior of core's versions. Objections? Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] utc-time-seconds and local-time-seconds rationale?
On 2014-05-07 12:01, Jörg F. Wittenberger wrote: However for the case at hand I'd even love a notation which allows to attach a custom message to the deprecated type. Possibly like this: I agree, an annotation for deprecation warnings would be valuable. Currently, it's totally on the user to go figure out why something's been deprecated and what to do about it; it would be nice to be able to include even something as simple as bar is deprecated, use baz instead in the warnings. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] utc-time-seconds and local-time-seconds rationale?
On 2014-05-07 13:12, Evan Hanson wrote: I agree, an annotation for deprecation warnings would be valuable. So this totally already exists, it just wasn't documented under (chicken types). In case anyone stumbles across this part of the archive: you can use the following type syntax to produce a warning, with advice to use bar instead: (: foo (deprecated bar)) Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] bug update-uri in uri-common
On 2014-06-08 11:14, Peter Bex wrote: On Sat, Jun 07, 2014 at 09:01:01PM -0400, John Cowan wrote: Peter Bex scripsit: c) The port should not be reset, but the uri should be printed without port if it's the default for this scheme. +1 for (c). hm, but if you really want to print http://foo:80/blabla, how should that work? In that case I don't think it's unreasonable to expect the user to define their own function to build a string from the URI's composite parts. We have to pick a default behavior one way or the other, and without the port seems like the better one to me. Regards, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Crash with multithreaded TCP code
Hi Christopher, On 2014-07-08 11:29, Christopher Collins wrote: I tried the above program with a newer version of chicken (4.9.0.1), and it works without issue. So I am considering the problem solved. Glad it's working -- thanks for following up, it's much appreciated. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] csc and standard input
Hi Michele, csc(1) will read source from standard input given the filename -. $ csc -o quick_test - (print 1) ^D $ ./quick_test 1 Whether csc(1) should default to standard input when no filename is given is a matter for debate, but that's how it's done as things are. Regards, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] [ANN] R7RS support egg
Hi all, An egg providing support for most of the R7RS Scheme language has been released for testing. It can be installed in the usual way, via `chicken-install`. It's still early days and doesn't cover the full specification yet, but it should be good enough for many R7RS programs so any testing you can provide is appreciated. If you do decide to try it out, please refer to the egg's wiki page for a list of known issues and caveats: http://wiki.call-cc.org/egg/r7rs Bug reports are more than welcome. Also, thanks to Seth Alves for lots of early testing. Cheers, Evan pgpz0Nk2_LEtu.pgp Description: PGP signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Macro returning multiple nodes?
Hi Mathieu, The usual way to do this is to splice the multiple forms you want to return into a `begin`: `(begin ,@(map (lambda (record-value) `(,(symbol-append record-symbol '- record-value) ,record-symbol)) record-values)) Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Printing recursive objects
Hi Richard, On 2014-09-24 21:34, Richard wrote: If I have an object that references itself, like for example... (define v (vector 0)) (vector-set! v 0 v) and I print it, chicken goes -understandably- into an infinite loop. Is there a way to prevent this, or is there something like define-record-printer for non-record objects. FWIW there are `display` and `write` procedures in the scheme.write library of the r7rs egg that handle such objects. That module is self-contained and can be used without pulling in the rest of r7rs: #;1 (use scheme.write) ; loading /home/evanh/.chickens/master/lib/chicken/7/scheme.write.import.so ... ; loading /home/evanh/.chickens/master/lib/chicken/7/chicken.import.so ... ; loading /home/evanh/.chickens/master/lib/chicken/7/scheme.write.so ... #;2 (define v (vector 0)) #;3 (vector-set! v 0 v) #;4 (display v) #0=#(#0#) Even so, csi's built-in writer will still loop on `v` if you don't explicitly print it. Maybe that behavior should also change when scheme.write is loaded, hmmm... Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] new egg: bindings for nanomsg
Hi Kristian, Done. It'll be available shortly. Thanks! Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] [Chicken-hackers] [PATCH] Fix cond behaviour of = with constant condition [Was: Re: Unbound = in cond statements]
On 2014-10-17 20:48, Peter Bex wrote: On Fri, Oct 17, 2014 at 07:44:27PM +0200, Michele La Monaca wrote: (cond (1 = odd?)) The attached patch fixes it. Pushed. Thanks very much Michele, Peter. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] [Q] How can I convert this lisp(SBCL) macro to chicken scheme?
Hi Sungjin, These are typically referred to as reader extensions in the Scheme world: http://api.call-cc.org/doc/library#sec:Reader_extensions You'll probabably want `set-read-syntax!` in particular: http://api.call-cc.org/doc/library/set-read-syntax! Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] readline egg v2.0 feedback
Hi Alexej, My tuppence: On 2015-01-27 4:01, Alexej Magura wrote: I don't think I'll use the toplevel-command stuff after all: I can't promise that the toplevel symbols readline exports won't get overwritten, and I'm not entirely sure readline has any business providing private toplevel symbols that are only applicable to it. It might confuse less-experienced users*, for one, and for another there's the already mentioned possibility of symbol collision, unless somebody more knowledge on this subject can prove otherwise. It's your call of course, but I'd urge you not to let this stop you if you'd otherwise like to provide this feature. If all commands are prefixed by rl, for example, the ease of use would outweight any risk of conflicts, IMO. After all, extensions are expected to provide commands; that's part of what the feature's there for. chicken-doc uses it to great effect, for example. Perhaps you could address the concern that users will mistake readline-provided commands for builtins by adding a note that they come from the readline egg to the commands' help strings? Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Up to date Chicken packages for most Linux distributions
Hi Daniel, On 2015-01-26 17:41, Daniel Ziltener wrote: I created a repository on the OpenSUSE Build Service with packages for most distributions. This is a very nice resource, thanks for taking the time to prepare it! This build service seems quite handy. Oh, and I'd be glad if users of other distributions than OpenSUSE could maybe give feedback if they really work as intended, but they should. The Debian packages don't seem to be using the libraries in /var/lib/chicken/7, but instead try to load them from /usr/local/lib/chicken/7 -- it seems $PREFIX isn't taking cleanly? I can collect some more info if you'd like, just let me know. Cheers, Evan signature.asc Description: Digital signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Correct type declarations for (call-with-... thunk) procedures
Hi Alaric, I agree it would be nice if one could capture the multiple values case with a `forall` type, e.g. (: call-with-foo (forall (a) (foo (- . a) - . a))) However, AFAIK there is currently no way to express this. You can of course specify that `call-with-context-support` may return an arbitrary number of values as follows: (: call-with-context-support (foo (- . *) - . *)) This will silence the warnings from `csc(1)`, but obviously isn't ideal. I've created a ticket[1] to track this feature request. Thanks for bringing it up! Evan [1]: https://bugs.call-cc.org/ticket/1176 ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] csc/csi man pages deficient
Hi Andrew, Of course you're right. I've created a ticket[1] to track this issue (really, a feature request for normal man pages). Best regards, Evan [1]: https://bugs.call-cc.org/ticket/1177 ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Parsing HTML, best practice with Chicken
Hi Piotr, I don't have much to add, other than to say that I agree with most of your points and to thank you for taking the time to write up your thoughts. On 2015-01-12 11:49, m...@freeshell.de wrote: -- an instruction how to get a running IDE with a REPL. I really struggled here (Sublime Text 2, EMACS). FWIW, I believe dleslie is doing some work in this area for Emacs users at https://github.com/dleslie/geiser. -- provide easier access to Chicken and egg sources. What would be the ideal way to access sources (or to discover how to access sources) for you? Also, are you aware of `chicken-install -retrieve eggname`? Anyway, thanks again. Cheers and happy 2015, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] macro and module question from newbie.
Hi, You must indicate that `m` should be visible within the expansion of `bar`, using the following export format: (module foo ((bar m)) ...) Otherwise, everything looks fine. See the IDENTIFIER syntax under http://wiki.call-cc.org/man/4/Modules#module for more information. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Geiser 0.7 Released (Chicken Support!)
+1, this is pretty great. Congrats, Daniel! ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Build error on MinGW
On 2015-04-24 15:48, Matt Gushee wrote: Anyone know why this would happen? Yes, I've also run into this issue recently. `getc_unlocked` is used when the compiler defines `_POSIX_C_SOURCE = 199506L`. This appears to be one standard too early, but even after adjusting the relevant #ifdef to check for the POSIX.1-2001 standard (in which this feature was specified) the build still fails. So, I guess MinGW is claiming POSIX.1-2001 but not providing `getc_unlocked`, so we'll probably have to add a workaround. In the meantime, try the attached patch. Cheers, Evan From f4be94bda231ed14ce375c958d3b68bb03a3f620 Mon Sep 17 00:00:00 2001 From: Evan Hanson ev...@foldling.org Date: Sat, 25 Apr 2015 10:16:39 +1200 Subject: [PATCH] Disable getc_unlocked --- chicken.h | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/chicken.h b/chicken.h index 69e0b95..5204385 100644 --- a/chicken.h +++ b/chicken.h @@ -976,11 +976,7 @@ DECL_C_PROC_p0 (128, 1,0,0,0,0,0,0,0) # define C_fputsfputs # define C_fputcfputc # define C_putchar putchar -# if (defined getc_unlocked || _POSIX_C_SOURCE = 199506L) -# define C_getcgetc_unlocked -# else -# define C_getcgetc -# endif +# define C_getc getc # define C_fgetcfgetc # define C_fgetsfgets # define C_ungetc ungetc -- 2.1.4 ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Fix date-literals to build install date-literals.import.so
Thanks Andy, I've updated the extension with your fix and tagged a new release. (Not that I'm volunteering to maintain the egg.) Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Termbox using
Hi frad, On 2015-05-02 12:34, f...@indexi.net wrote: Newbie with Scheme, i try to use the termbox egg. It seems me a very nice and cool library and the documentation helps me a lot. That's a very nice extension, indeed, thanks for bringing it to attention. It even bundles the termbox library itself. Nice work, pluizer. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Openssl with csc -deploy
Hi Nick, I've used the following commands for this. The only difference is the third command, which copies CHICKEN's core libraries into the deployment directory. I have a hunch as to why this makes the difference, but it's orthogonal to your problem, so for now can you just try adding `chicken-install -i foo` to your build process and see if this works? $ cat foo.scm (use http-client) (print (call-with-input-request https://call-cc.org; #f (cut read-string #f ))) $ csc -deploy foo $ chicken-install -i foo $ chicken-install -p foo -deploy http-client openssl $ ./foo/foo [... response ...] Cheers, Evan signature.asc Description: Digital signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] [ANN] New egg: sass (CSS preprocessor library)
Hi Matt, On 2015-05-17 17:24, Matt Gushee wrote: Mario or someone, could you please add this egg to the directory? Done! Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Annoying compiler warning
Hi Matt, This has been addressed in the development tree and the warnings will go away with the next release. As for hiding the warnings on 4.9.0.1, you could try passing a flag to silence them as a C compiler option (perhaps -Wno-deprecated? I don't know which option will suppress these messages, but one surely exists), or simply define that feature yourself: $ csc -C -D_DEFAULT_SOURCE foo.scm Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Statically Linking Eggs
Hi Nick, On 2015-05-18 9:12, Nick Andryshak wrote: Would it be feasible to make my own object files for eggs that don't include them by using chicken-install -retrieve, and then compiling the sources? Yes, and it's straightforward to do for most extensions -- I've used this approach for a few projects myself -- but it requires manually compiling every single dependency in turn so the task balloons very quickly unless you consciously avoid using eggs with many dependencies. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Statically Linking Eggs
Hi Nick, On 2015-05-11 13:31, Nick Andryshak wrote: But can you statically link Eggs anymore? There's like 40 files in the deployment folder after deploying only one extension, I'd like a single, static executable. Is this possible? It's possible if all of the eggs you need to use provide suitable object files for static compilation, but this is not currently supported in any meaningful way by the toolchain and it's unlikely to be possible for all of those 40 files you're trying to use. The sysexits egg is a very simple example of an extension that provides an object file for static linking: $ cat foo.scm (import sysexits) (exit exit/ok) $ chicken-status -f sysexits /usr/local/lib/chicken/7/sysexits.import.so /usr/local/lib/chicken/7/sysexits.o /usr/local/lib/chicken/7/sysexits.so $ csc -static -uses sysexits foo.scm /usr/local/lib/chicken/7/sysexits.o $ ./foo However, this practice is not widespread. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] ANN: new chicken-iup Windows installer with IUP gui, canvas-draw, scintilla etc. released.
On 2015-05-20 11:49, Stephen Eilert wrote: Just a heads up: chicken won't be able to import anything as soon as it is installed, due to the fact that new system environment variables get added. Logging out (or restarting) is enough to fix it. Ah, thanks Stephen, this caught me up too. I can confirm that the installer works on Windows 7 after logging out and in again. It's probably worth mentioning this step somewhere on the project page. Anyway, nice work, thanks to everyone involved! Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] read-u8vector: types.db inconsistent with documentation
Thanks Andy, this warning is indeed incorrect. A patch has been posted to fix it. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Bug in readline 4.0 egg; missing function
On 2015-08-07 18:30, Alexej Magura wrote: Fixed the problem; rolled out v4.1.0 of the Readline egg. Works here with Readline library version 6.3. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] CHICKEN 4.10.0 release candidate 4 available
Hi Tim, Thanks for the report, it's much appreciated. On 2015-07-27 15:31, Tim van der Linden wrote: The [panic] line (marked with in front) might be a possible failed test? That panic line is fine and expected -- it's part of the test. Furthermore, as you can see, the system does progress a bit but hangs at the last line. I have let it run for 2 hours, and it did not get past this GCC compiling step. Either this Atom system is too weak to run these test in a timely fashion, or something else is going wrong... Looks like you're running into an issue with GCC 4.9 that a few others have encountered, as well -- the runtime tests do indeed run indefinitely on some platforms when that compiler is used.9. If possible, could you rerun that build with C_PLATFORM=some other gcc so that we can see the whether the remaining tests pass, that GCC bug notwithstanding? Thanks again, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] one more egg - need advice how wrt. exports
On 2015-11-03 21:29, "J??rg F. Wittenberger" wrote: > Firstly I have not found a way to rename identifiers on export (as in > r6rs libraries). Is there really no way or did I miss it? There is really no way. Except for the obvious way of simply using `define` within your module. But, I doubt that's what you're after. It'd be a nice feature to have at some point, not least because the R7RS mandates it. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Help with usage of process ...
Hi Matt, My guess is that because you don't close the output port before waiting for results, dot(1) sits there waiting for more input and your procedure appears to hang. I'd try closing `oup` once you've written your graph to the process, for example by making the thunk you use for the "dot writer" thread look like: (lambda () (with-output-to-port oup (lambda () (map print indat) (close-output-port oup Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] vim support for s-expression comments
On 2015-08-26 11:02, Blake Sweeney wrote: These look nice thanks! It would be great if you could put these into a git repo, to make them easier to use with a package manager. Either way, thanks for providing them! OK, I've pushed them to http://git.foldling.org/vim-scheme.git/. Tested with Vundle, works. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] ldap-bind egg
Hi Caolan, Added. You may also want to add libldap to the egg's metafile as a (foreign-depends ...), for informational purposes. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] vim support for s-expression comments
Hi Sven, I maintain reasonably good Vim configurations for Scheme and CHICKEN, available at http://foldling.org/~evhan/misc/vim/. They can be dropped into the corresponding paths of your ~/.vim directory. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Hypergiant egg install fails, and some other eggs
On 2015-10-02 11:03, Robert Herman wrote: > In any case, Termbox has not dependencies IIRC termbox bundles a C library (perhaps just one file?) that it compiles during chicken-install. In that sense, it does have one dependency. It'd be worth checking that, to see whether it makes some assumptions about the platform, and whether it's compatible with your Windows environment. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Why define-constant is not a constant?
Hi Joe, That's not really what `define-constant` is for. Here, "constant" means "constant value", not "lexical identifier that can't be changed". Even so, the compiler does happen to do what you're expecting (as opposed to the interpreter, where `define-constant` is equivalent to `define`): $ cat foo.scm (define-constant test1 "initial value") (define test1 "I got changed") (print test1) $ csc foo.scm $ ./foo initial value Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Hello! I'm new and need some pointers please ~
Hi Federico, and welcome. Stylistically, a cond expression like this[1] can be more clearly written as a case (http://api.call-cc.org/doc/scheme/case). Similarly, this[2] can be rewritten as a case if you make `string-head` return characters rather than strings of length one. This will also be much more efficient. Your string helpers should also probably use string-length, ref, et al. as well, rather than converting back and forth to a list, which is quite wasteful. [1]: https://github.com/gosukiwi/chicken-brainfuck/blob/master/src/parser.scm#L72 [2]: https://github.com/gosukiwi/chicken-brainfuck/blob/master/src/tokenizer.scm#L10 On 2015-11-28 20:25, Matt Gushee wrote: > http://api.call-cc.org/doc/ [...] Look for the 'chickadee' egg. +1. There is also the chicken-doc egg, if you fancy the command line: http://wiki.call-cc.org/eggref/4/chicken-doc > Also, I glanced at your code; I noticed you were using various (declare > (unit ...)) and (declare (uses ...)) declarations. As I understand it, > those declarations may or may not be formally deprecated, but they are not > much used any more; the general practice these days is to use modules > rather than units. Declaration are very useful, but it's true that they're most useful when you know your way around the toolchain fairly well, and have specific ideas about how you want the compiler to behave. People coming from high-level languages usually find modules more intuitive, especially as a way to organize code. On 2015-11-29 1:11, fedekun wrote: > (Oh btw, any recommended book on Scheme which I follow along using > CHICKEN?) My personal favorite is TSPL, which is a fantastic book for learning Scheme (R5RS, not CHICKEN in particular): http://www.scheme.com/tspl3/. Best regards, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] [ANN] sdl2 and sdl2-image 0.1
On 2015-12-19 21:19, John Croisant wrote: > Version 0.1 of the sdl2 and sdl2-image eggs are now ready! These look great, and fantastically thorough. Very nice work. FWIW, the sdl2 egg fails to build with gcc-4.6: In file included from sdl2-internals.c:14:0: lib/sdl2-internals/custom-functions.c: In function ‘chickenSDL2_RotateSurface90’: lib/sdl2-internals/custom-functions.c:212:3: error: ‘for’ loop initial declarations are only allowed in C99 mode lib/sdl2-internals/custom-functions.c:212:3: note: use option -std=c99 or -std=gnu99 to compile your code lib/sdl2-internals/custom-functions.c:213:5: error: ‘for’ loop initial declarations are only allowed in C99 mode lib/sdl2-internals/custom-functions.c: In function ‘chickenSDL2_FlipSurface’: lib/sdl2-internals/custom-functions.c:267:3: error: ‘for’ loop initial declarations are only allowed in C99 mode lib/sdl2-internals/custom-functions.c:268:5: error: ‘for’ loop initial declarations are only allowed in C99 mode Building with gcc-5 instead worked fine. The sdl2-image project didn't have this problem. All tests pass, the examples work, and eggsweeper is great. This is on Debian sid. > Here are the release-info files for the two new eggs. Please add them to > egg-locations. :) Done. Thanks much, John. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] How do you compile multiple modules into a single executable?
Hi Josh, I think the following is what you're after. $ cat foo.scm (module foo * (import scheme) (define (foo) 1)) $ cat bar.scm (import foo) (print (foo)) $ csc -c -unit foo -emit-import-library foo foo.scm $ csc -uses foo bar.scm foo.o $ ./bar 1 Note that when compiling bar.scm with foo as a unit this way, (use foo) becomes (import foo). Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] How do you compile multiple modules into a single executable?
The `compiling` feature specifier is only expanded when compiling, so something like `(cond-expand (compiling (import foo)) (else (use foo)))` ought to work. To be totally honest, in this specific situation you can actually get away with using just `(use foo)` since the "-uses foo" flag tells csc that foo is a unit and doesn't need to be loaded at runtime either way, but to avoid confusion I think it's best to use the right form for the situation. Hope that helps, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Any decent web development framework
On 2015-12-27 23:56, 机械唯物主义 : linjunhalida wrote: > (get "/" (lambda (request) "hello") > (get "/from/:id" (lambda (request) (sprintf "hello ~A" (request 'id > (get "/page/:id" (lambda (request) > (let ((data ($query (from pages) (where (= id (request 'id)) > (render "templates/page" ('data data Awful is somewhat similar to Sinatra, and basically does what you're describing, so I'd suggest having another look at it. It's worked for me in the past, anyway. Or, as others have mentioned, you can use Spiffy directly, hand-roll a `render` method, and maybe use some helper eggs for things like routing: http://api.call-cc.org/doc/spiffy-request-vars http://api.call-cc.org/doc/spiffy-uri-match Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Bug: define-foreign-type causes confusing messages to be printed
Thanks John, Issue #1237 has been created for this issue: https://bugs.call-cc.org/ticket/1237 The detailed report is appreciated. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] new egg macro-rules
Hi Juergen, This is a handy interface, thanks for extracting it. FWIW, it looks like the procedural-macros *procedure* (the documentation procedure) isn't exported. I'm not sure if that's intentional or not, but it's mentioned on the wiki page. Speaking of which, do you use some tool to generate wikidoc from those #|[...]|# forms? Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] [ANN] git-fs
Hi all, Last year I wrote a program that serves Git repositories as read-only file systems. I showed it to some folks at ICC and it's been stable for a while now, so I figured I'd announce it here too. http://git.foldling.org/git-fs.git/ The most recent binary package, git-fs_0.0.3-x86_64.deb, is known to work on Debian sid, at least. Let me know if you run into installation problems. Best regards, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Need help to figure out where this strange performance impact is coming from
On 2016-01-13 9:32, Dan Leslie wrote: > IIRC, there's been ongoing efforts to remove SRFI-1 from core; which > may explain your observations regarding Master. Just for the record, Dan's right that moving srfi-1 out of core and into an egg is being done as part of CHICKEN 5, but there are no plans to drop srfi-1 from core in the 4.X release series. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Is there interest in this Prolog interpreter packaged as an egg?
On 2016-02-21 15:21, Jeronimo Pellegrini wrote: > (compile -X r7rs -R r7rs -s -O2 "pll.scm" -unit pll) > (compile -X r7rs -R r7rs -s -O2 "pll.import.scm" -unit pll) You shouldn't use "-unit pll" here. That's what's causing the error, and in this simple case where you're compiling a more-or-less standard extension that provides shared libraries, you don't need it. The software looks very cool, by the way. Thank you for packaging it. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Understanding modules?
Hi Norman, A quick note about units and modules: the two are different things used for different purposes. The former has to do with controlling the compilation and linking of separate application components, whereas the latter is about namespace management. The hunt continues for the best way to explain either of these features in the manual (particularly without confusing the two with one another, or with other features such as deployment or the use of dynamic libraries), but they're almost entirely orthogonal and equally useful, just for different things. > Deployment: Either in the 'Modules' page (along with the other examples at > the end) or in the 'Deployment' page, it would be useful to show how to > deploy a program using modules. The obvious things don't appear to work: This looks like a bug to me. Based on the commands you listed, that application "main/main" should work fine, so I suggest reporting this on bugs.call-cc.org, if you don't mind. > I've assembled a short list of minor buglets in eggs and egg documentation. > Is it best if I report them here, or should I ask for an account on > http://bugs.call-cc.org ? The best approach is probably to report these individually on bugs.call-cc.org. The documentation for any given egg is generally managed by that egg's maintainer, so bug reports about their documentation will ideally be grouped by extension rather than in one big ticket so they can be correctly assigned. Thanks very much for the detailed write-up -- feedback like this is quite valuable. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Is there a replacement for expand-home-path in 4.11rc2?
Hi Matt, On 2016-05-14 14:28, Matt Welland wrote: > I used resolve-pathname from posix-extras and expand-home-path is no longer > available. Is this intended to be fixed? If it is not to be fixed what is > the suggested way to expand a path, use readlink -f? This behaviour is now provided by http://api.call-cc.org/doc/pathname-expand The posix-extras egg still needs to be updated as such. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken 4.10.0 and 4.10.1 - 'check' fails
Hi Claude, It's likely you're running into this issue: http://bugs.call-cc.org/ticket/1269 Note that it has been fixed in the 4.11 release candidate. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] generate numerical list
Hi Jinsong, SRFI-1 provides `iota' -- http://api.call-cc.org/doc/srfi-1/iota Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] New egg: level-sexp
Hey Caolan, Looks cool. Added, thanks. Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Results of testing CHICKEN 4.12.0.rc1 on various platforms
On 2017-01-28 16:44, Peter Bex wrote: > On Wed, Jan 25, 2017 at 08:41:02PM +0100, alexander.she...@web.de wrote: > > Your patch solves the problem with the POSIX tests. Now only the deployment > > tests fail, but deployment is probably unsupported on Android, because the > > Android dynamic linker lacks the "rpath" feature. > > I don't know if we can somehow avoid running those tests on platforms > where it's known not to work... We already disable the deployment tests on some platforms, so we'd just need some way to reliably determine from sh(1) whether we're on Android or not. The other cases of this use `uname -s`, so perhaps that would work. Alexander, could you tell us what that command reports on Android? Evan signature.asc Description: PGP signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] [ANN] CHICKEN 4.12.0 release candidate 2 available
Hello everyone, The second release candidate for CHICKEN 4.12.0 is now available for download: http://code.call-cc.org/dev-snapshots/2017/02/06/chicken-4.12.0rc2.tar.gz The SHA-256 sum of that tarball is: 19bc4d2e2a866a84f5fcd71af55b4c924fa1409ad990e9d912e41d1975da7a3a The list of changes since version 4.11.0 is available here: http://code.call-cc.org/dev-snapshots/2017/02/06/NEWS There have been only minor changes since the previous release candidate. These specifically relate to the iOS, macOS and Android platforms. Please give this snapshot a try and report your findings to the mailing list, particularly if you're able to contribute a test report for one of the aforementioned platforms. Here's a suggested test procedure: $ make PLATFORM= PREFIX= install check $ /bin/chicken-install pastiche If you can, please let us know the following information about the environment on which you test the RC: Operating system: (e.g., FreeBSD 10.1, Debian 8, Windows 7 mingw-msys) Hardware platform: (e.g., x86, x86-64, PPC) C Compiler: (e.g., GCC 4.9.2, clang 3.6) Installation works?: yes or no Tests work?: yes or no Installation of eggs works?: yes or no Thanks in advance! The CHICKEN Team signature.asc Description: PGP signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] CHICKEN 4.12.0 release candidate 2 available
Hi Claude, Thanks for testing the RC, it's appreciated. On 2017-02-13 21:32, Claude Marinier wrote: > With current MinGW-w64 and PLATFORM=mingw-msys : builds successfully and > checks die with the same error as 4.11. > > [panic] invalid encoded numeric literal - execution terminated > > See http://lists.nongnu.org/archive/html/chicken-users/2016-08/msg9.html > > If I am the only one experiencing this error, is it worth pursuing? You are not the only one -- this is a known issue and something we'd like to fix but haven't gotten to yet. Refer to https://bugs.call-cc.org/ticket/1344 and please feel free to elaborate if you have any details to add. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] set! on unbound variable
Hi Jinsong, Not a bug, but certainly something that can be confusing if you don't expect it. In your example, `helo` is implicitly defined as a toplevel variable at the point of `set!. The difference is noted (very, very succinctly) in the manual here: http://wiki.call-cc.org/man/4/Extensions%20to%20the%20standard#set Unfortunately there's not currently a way to generate a warning in this situation, that I know of. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Curious about limitations of fuse egg, can't open a fossil on the hashfs example fuse fs.
Oh, I should also point out that if you install the egg with `chicken-install -D fuse-debug ...`, it will log filesystem requests as the server receives them (to stderr, IIRC). Might be useful as a quick way to see what's going on without breaking out the heavy tools. HTH, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Curious about limitations of fuse egg, can't open a fossil on the hashfs example fuse fs.
Hi Matt, Interesting, cool project. Here are a few guesses at your questions, without having had a look at the specific steps to reproduce. On 2016-09-19 22:24, Matt Welland wrote: > 1. Can't open a fossil on hashfs: I'd bet this is caused by SQLite trying to lock a file with flock(2), which isn't implemented by hashfs.scm or, for that matter, by the egg itself. I'd like to add support for flock callbacks at some point, but even then you'd still need to extend hashfs.scm to do something meaningful with that callback in order to get Fossil to work (assuming I'm right about the underlying issue, that is...). > 3. du -sh returns zero even for a non-empty directory. There's a longstanding TODO in the egg relating to explicit blocksize handling, and I'd bet money this is down to that. In short, the egg only bothers to fill the st_size field of stat structs, leaving st_blksize empty since there isn't really a block size associated with a synthetic filesystem anyway. Usually this is fine since the size in bytes is already provided and most tools will just use that (or assume 512 as the block size, in some cases), but it might be that du(1) is taking that empty field at face value and reporting odd sizes as a result. On Linux, you can get du(1) to report the "real" size of a file (i.e. in bytes, not blocks) with `du -b`, so in your example `du -bsh` *should* report nonzero values for nonempty directories, unless there's something else going on. > 2. On hashfs Megatest compile gets through making the .o files but fails to > link with an error: This might be similar to #3. I may have a go at fixing that TODO soon, and if I do I'll let you know -- I'd be curious to see if that is indeed the cause. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] r7rs improper redefinition of imported symbol
Hi John, You're quite right, this was indeed a bug relating to which bindings are implicitly available within R7RS libraries. This should be fixed in 0.0.5, just released and available shortly. If you could have a go with that version and let me know if you still run into problems, I'd appreciate it. Thanks for the report and the nice little test case. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] compiled program + REPL ?
Hi there, I'd say (2). IME the nrepl egg from the fine folks at Adellica is a nice option for this: http://wiki.call-cc.org/eggref/4/nrepl Possibly also (5) with some blood, sweat and tears, but AFAIK nothing like (4) exists. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] New egg - directory-tree
Hi Peter, On 2016-11-01 13:59, Peter Nagy wrote: > while working on a small home project I decided to port gauche's > (create|check)-directory-tree functions over to chicken and release my > first (small) egg. Looks useful, thanks! > Let me know if anything else is needed from my side, if not I will > make a tag on gitlab to finalize the release. Everything looks good to me, it just needs a tag. I've just added it to the repository, so it will become accessible shortly after the tag is created. > I think I managed to get everything done based on the wiki except > documentation. Can I create it within my project in some format and it > would get linked in wiki.call-cc.org/eggref/4 ? Or should I just > create the page for my egg there and add the docs there? The latter. Some people keep a version of the documentation in the project tree, but actually putting it on the wiki is a manual process. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Compiling multiple modules into a single executable
Hi Josh, On 2016-10-16 21:13, Josh Barrett wrote: > Oh. Thanks. Can you generate a .import without compiling your module? You can use the "-analyze-only" flag: $ csc -analyze-only -emit-import-library foo foo.scm Note that you must specify the modules whose import libraries should be generated with "-emit-import-library" (or "-j") in this case; using "-J" won't suffice. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] New egg: lmdb-lolevel
Hey Caolan, Looks cool, added. It should become available in the next few minutes. Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] pass/retrieve arguments by reference in lazy-ffi
Hi Kevin, I doubt anyone will be able to test your program, not having access to "cpuidsdk.dll", but it's unsurprising that it exits silently; there's nothing in your program that would do anything else, so it's probably just running from start to finish and quitting when it's done. Without a call to `print` or some other side-effecting expression, that's to be expected. Does the same happen when you load your file in interactive csi session? HTH, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users