[Chicken-users] Redefining a macro in terms of its earlier definition

2009-11-19 Thread Tony Sidaway
Suppose I have a macro, mac. I want to modify the expansion to expand to something along these lines: (if condition new-code old-mac) where old-mac would be an expansion of the old macro mac with exactly the same arguments. This would enable macros to be extended in a way that is compatible

[Chicken-users] Wikipedia

2009-10-19 Thread Tony Sidaway
The Wikipedia article on Scheme had been of rather poor quality for some time and I always meant to do something about that. During the past week or so I've given it a pretty severe rewrite, and in doing so I've learned a lot about Scheme, and particularly its history, that I didn't realise I

Re: [Chicken-users] http cookie order

2008-03-31 Thread Tony Sidaway
Thanks for a very informative analysis. Of course this whole problem only cropped up because we Schemers like to build up lists by consing new elements to the front. I would probably have included a reverse in the result of the let loop without thinking, but unless you have reason to suspect

[Chicken-users] http cookie order

2008-03-27 Thread Tony Sidaway
Using http.egg to write a bot that has to login to a ubb forum, I discovered that the cookie processing order of that egg resulted in login failure. When I tweaked http:read-request-attributes to reverse the order of the attributes it returned, all was well. This is because in reply to a

[Chicken-users] 2.739 build problems

2007-12-21 Thread Tony Sidaway
This is a result of my attempt to rebuild from a copy of trunk taken this evening. I'm building on a recent install of Ubuntu Gutsy Gibbon. The underlying chicken installation (used for bootstrapping) is 2.732. [EMAIL PROTECTED]:~/Projects/Installs/chicken$ make PLATFORM=linux PREFIX=/usr/local

Re: [Chicken-users] inlining

2007-09-21 Thread Tony Sidaway
On 9/13/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thu, 13 Sep 2007 10:56:33 +0200, Felix wrote: You must compile in block mode, or hide the procedures that you want to have inlined: a procedure can not be inlined, if it is globally accessible. Thanks, Felix. After adding the csc

Re: [Chicken-users] emacs editing mode for chicken ?

2007-09-19 Thread Tony Sidaway
On 13 Sep 2007 14:55:13 -0300, Mario Domenech Goulart [EMAIL PROTECTED] wrote: Quack: http://www.neilvandyke.org/quack/ http://chicken.wiki.br/Editing%20Chicken%20code If you do use quack.el, you should perform the following edits: In ~/.emacs Add (load-file ~/quack.el) In ~/quack.el

Re: [Chicken-users] Packaging libraries securely

2007-09-19 Thread Tony Sidaway
On 8/9/07, felix winkelmann [EMAIL PROTECTED] wrote: On 8/8/07, felix winkelmann [EMAIL PROTECTED] wrote: The sandbox egg will be the only thing that gives a bit of security, but it provides only a very basic Scheme dialect and is pretty slow. The only (somewhat brute-forcish) solution

Re: [Chicken-users] Scheme-themed cloth badges?

2007-09-19 Thread Tony Sidaway
Last time I was at Gay's the Word, which was admittedly a long time ago (well what with the wife and the kids...) there were plenty of badges of all types bearing a lambda, which has been a gay symbol for some decades now. This could cause confusion if you're heterosexual, but for gay schemers

[Chicken-users] Packaging libraries securely

2007-08-07 Thread Tony Sidaway
This is basic stuff. I think it's a bit ridiculous that I'm asking this question so late in my project. Part of my executable, written by me, needs to do all kinds of hairy, scarey stuff with my native operating system, an external website (Wikipedia, actually), but another part of my executable

[Chicken-users] Iron Chicken

2007-07-07 Thread Tony Sidaway
I'm working on some bot code for wikis based on the Mediawiki engine, which powers Wikipedia. My project name is Iron Chicken. Currently I've got an egg, irnc-base (Iron Chicken base) which implements the api.php interface to mediawiki, and also enables login and editing via the usual nasty

[Chicken-users] Projec mayo: a scheme sourrce level debugger for Chicken

2007-03-09 Thread Tony Sidaway
I'm quite close to releasing a basic source-level debugger for Chicken. The first release will provide the user with a modestly enhanced GNU debugger environment. As well as the existing functions provided by gdb at C source level, the user will have the ability to load applications by their

[Chicken-users] mayo.egg: the first alpha release of a Scheme source-level debugger for Chicken

2007-03-09 Thread Tony Sidaway
This is now available for use. it's basically a proof of concept, showing how gdb.egg (which is intentionally built for versatility rather than usability) can be used to construct a mapping from Scheme to C which enables an end user to debug a Chicken scheme program. This egg is capable of

Re: [Chicken-users] SWIG and callbacks

2007-03-04 Thread Tony Sidaway
On 3/4/07, felix winkelmann [EMAIL PROTECTED] wrote: You also have to save the callback-continuation (see generate-foreign-stubs in c-backend.scm). For the swig-specific information, you should contact John Lenz (who wrote the swig backend). Thanks. I just checked c-backend.scm this

[Chicken-users] SWIG and callbacks

2007-03-03 Thread Tony Sidaway
I'm trying to write a callback in Scheme. The unusual thing about this callback is that it's intended to be invoked during the course of a Swig call. I know that our native FFI has foreign-lambda and foreign-safe-lambda, the latter intended for this kind of circumstance. My question is: does

[Chicken-users] Passing Scheme callbacks to Swig wraps.

2007-02-28 Thread Tony Sidaway
I've been using Swig to wrap a medium sized C++ library. Part of the task involves enabling the dynamic method pointers built into this particular class hierarchy to be manipulated by the Scheme programmer. As a concrete example, I want to enable the Scheme programmer to be able override the

[Chicken-users] Re: Passing Scheme callbacks to Swig wraps.

2007-02-28 Thread Tony Sidaway
On 2/28/07, Tony Sidaway [EMAIL PROTECTED] wrote: As a concrete example, I want to enable the Scheme programmer to be able override the menubar method with a method written as a Chicken Scheme callback (define-external) procedure, by passing a pointer to that callback to the setter for the C

[Chicken-users] New user-interface egg: slang.egg

2007-02-26 Thread Tony Sidaway
S-Lang (also known as slang or SLang, I'll call it slang from now on) is a very well established, well supported, text-based user interface. John E. Davis used slang to produce his slrn Usenet newsreader and the JED text editor, and the mutt mailer and lynx web browser also use slang's display

[Chicken-users] Problem mapping to unsigned char *

2007-02-26 Thread Tony Sidaway
The nearest thing we have for mapping unsigned char * is c-string, but using that interface makes a compiler complaint of the following type: slang.c:1254: warning: pointer targets in passing argument 1 of 'SLang_buffer_keystring' differ in signedness This is just a niggle, really, because it

Re: [Chicken-users] Problem mapping to unsigned char *

2007-02-26 Thread Tony Sidaway
On 2/26/07, John Cowan [EMAIL PROTECTED] wrote: Actually, it's architecture dependent whether char is a synonym for signed char or for unsigned char. Rather than complicating the interface, I'd rather live with the gcc warning. Yes, you would want to use c-string without a sign qualification

[Chicken-users] Safe interrupt handlers?

2007-02-26 Thread Tony Sidaway
An interrupt handler written in Chicken Scheme probably can't do a lot without knocking over a heap of dominoes. Nevertheless, would a simple lambda that only changes a top level flag variable be stable enough to be useful? This is often all that posix interrupt handlers written in C do anyway.

[Chicken-users] Re: Safe interrupt handlers?

2007-02-26 Thread Tony Sidaway
To clarify my earlier post, procedure sigX-handler should be executed when the interrupt fires. The procedure handle-sigX is executed by the program when it polls the signal flag and finds it in a set state. ___ Chicken-users mailing list

[Chicken-users] swig and c++ and stuff

2007-02-26 Thread Tony Sidaway
I tried a big SWIG wrap on part of a C++ library. This generated a .cxx wrap file and a .scm file. The build sequence I'm using is this: $(CHICKEN) tvision.scm -output-file otvision.c $(CXX) --shared otvision.c tvision_wrap.cxx -o tvision.so `rhtv-config --include` `rhtv-config

Re: [Chicken-users] swig and c++ and stuff

2007-02-26 Thread Tony Sidaway
On 2/26/07, felix winkelmann [EMAIL PROTECTED] wrote: The missing symbol is strange, though. Check the _wrap.cxx file and the binaries with nm (and c++filt genRefs() only appears as a friend function in the class prototypes; it isn't implemented so it doesn't belong in the wrap. I removed

[Chicken-users] gtk2 and gtk2-gobject eggs, release 0.3

2007-02-20 Thread Tony Sidaway
I've just committed gtk2-object.egg and gtk2.egg releases 0.3. Later on I'll probably commit gtk2-glade.egg 0.3. The frequent crashes are a thing of the past; this is stable code. I'll declare a beta release when I've resolved some build issues and obtained (or produced) a maintainable version

[Chicken-users] New tool: patch.egg

2007-02-19 Thread Tony Sidaway
This is a tool for producing and performing software patches, inspired by the patch program by Larry Wall and Paul Eggert. It provides procedures to produce patches, apply them and reverse them. It depends on the posix extension, and to produce patch files you will first need to produce GNU

[Chicken-users] Simple GUI features

2007-02-15 Thread Tony Sidaway
While it may be rather difficult, and possibly even impracticable, to produce a general super GUI, it should be possible for all Chicken GUI eggs to provide GUI features in a uniform way. To show the kind of thing I'm thinking of, I'll give some examples, graded by level of complexity. It isn't

Re: [Chicken-users] gtk2.egg

2007-02-14 Thread Tony Sidaway
On 2/13/07, Andre Kuehne [EMAIL PROTECTED] wrote: Tony Sidaway wrote: [...] The main part of the code is a pretty straightforward wrap of libgtk2 and libglade. The only unusual thing is that a bespoke wrap program is used instead of SWIG, and relies on defs files that are published

[Chicken-users] gtk2.egg

2007-02-11 Thread Tony Sidaway
$ svn co https://galinha.ucpel.tche.br/svn/chicken-eggs/gtk2 (login anonymous, leave the password response empty) This may be of interest to GUI enthusiasts. The interesting part of the code, to me, is what is built on top of the wrapped library. g+ is a very clean, Scheme-like GUI library

[Chicken-users] GUI: thoughts on practicality.

2007-02-08 Thread Tony Sidaway
It's been my feeling for some time that it should be possible for a Scheme programmer to create windows with menus, buttons, and whatnot, with a reasonable expectation that the details of implementation can be left to low level drivers. Furthermore, the Scheme programmer should be able to write

Re: [Chicken-users] GUI: thoughts on practicality.

2007-02-08 Thread Tony Sidaway
On 2/8/07, minh thu [EMAIL PROTECTED] wrote: So in your conception, accessing the event queue must be explicitly possible ? Usually, you can just provide a callback and wait for the system call it. A translating dispatcher might be used for implementation, basically a bit of glue code that

Re: [Chicken-users] GUI: thoughts on practicality.

2007-02-08 Thread Tony Sidaway
On 2/8/07, Brandon J. Van Every [EMAIL PROTECTED] wrote: minh thu wrote: Again sorry for my 'random' (Brandon would call it 'insane' :) ideas... Ideas aren't insane. The labor of refactoring for multiple platforms is insane. I think people don't realize how little labor they're working with

Re: [Chicken-users] GUI: thoughts on practicality.

2007-02-08 Thread Tony Sidaway
On 2/8/07, Brandon J. Van Every [EMAIL PROTECTED] wrote: Tony Sidaway wrote: It might be amusing to frame a GUI project as a challenge to Gambit or Bigloo programmers! :) I threw down the gauntlet to the Steel Bank Common Lisp crowd a number of months back. I said their Windows build

Re: [Chicken-users] Evicted objects

2007-02-06 Thread Tony Sidaway
On 2/6/07, felix winkelmann [EMAIL PROTECTED] wrote: On 2/6/07, Tony Sidaway [EMAIL PROTECTED] wrote: My expectations are obviously wrong. What's happening there? Since Scheme strings do not have a zero-terminator, the call to getmem will receive a copy of the string, with a 0-terminator

Re: [Chicken-users] idiomatic/usual way of file-based configuration in Scheme

2007-02-06 Thread Tony Sidaway
On 2/6/07, minh thu [EMAIL PROTECTED] wrote: It would just amount to read a list of key/value pairs in Scheme syntax. Or maybe a triple if the type is given. What do you use ? As I think you realise, this is a capability that is as old as Lisp itself. A property list is just a specialized

Re: [Chicken-users] What happens to a (non-simple) Scheme object sent to a foreign function?

2007-02-05 Thread Tony Sidaway
On 2/5/07, felix winkelmann [EMAIL PROTECTED] wrote: Another option would be to create a GC root (CHICKEN_new_gc_root) and keep it on the C-side (you have to pass the argument string as a scheme-object, then create the GC-root from it). Later, you can access the gc root (CHICKEN_gc_root_ref) and

Re: [Chicken-users] Re: object-evict, string ports, safe-foreign-wrapper, foreign-primitive, Cheney on the Victoria Line, etc (was: What happens to a (non-simple) Scheme object sent to a foreign funct

2007-02-05 Thread Tony Sidaway
On 2/5/07, felix winkelmann [EMAIL PROTECTED] wrote: sufficiently big). An alternative is to create a suitably sized byte-vector beforehand (in Scheme, using the heap) and copying the data inside a block of foreign code (or use move-memory!). Ah! I didn't know move-memory existed. This is

Re: [Chicken-users] cross-platform gui toolkit

2007-02-05 Thread Tony Sidaway
I'm considering the pros and cons of this, but I am with Felix in the belief that a simple, Schemish basic GUI layer design is desirable. It shouldn't require Qt or Gtk, which are both on the heavy end of GUI toolkits. Instead it should provide a layer that works on top of whatever GUI tools are

[Chicken-users] object-evict isn't working as expected.

2007-02-05 Thread Tony Sidaway
What's up here? I have a Scheme string that I want to send to a C library. The library will remember its location and so I want it to be in static memory, so I use object_evict and send the result of object-evict to the library as a c-string argument to a foreign-lambda. The library now knows

[Chicken-users] Evicted objects

2007-02-05 Thread Tony Sidaway
This is the crux of it. $ cat testevict.scm (use lolevel) (define (myalloc size) (printf Requested ~S byte\n size) (let ((obj (allocate size))) (printf ~S\n obj) obj)) (define getmem (foreign-lambda* void ((c-string ptr)) printf (\ptr = %p\\n\, ptr);)) (define s A string) (define e

[Chicken-users] object-evict, string ports, safe-foreign-wrapper, foreign-primitive, Cheney on the Victoria Line, etc (was: What happens to a (non-simple) Scheme object sent to a foreign function?)

2007-02-04 Thread Tony Sidaway
On 2/4/07, Thomas Christian Chust [EMAIL PROTECTED] wrote: Tony Sidaway wrote: I'm sending a Scheme string to a foreign (C) library as a c-string. I also send it the address of a Scheme procedure created as define-external--this address is sent as a c-pointer. [...] Hello, the address

[Chicken-users] Re: object-evict, string ports, safe-foreign-wrapper, foreign-primitive, Cheney on the Victoria Line, etc (was: What happens to a (non-simple) Scheme object sent to a foreign function

2007-02-04 Thread Tony Sidaway
On 2/4/07, Tony Sidaway [EMAIL PROTECTED] wrote: Another problem that it would be helpful to have advice on is how to cast or coerce arbitrary data received in a Chicken safe-foreign-wrapper. Say I receive a foreign c-pointer to some data and a couple of parameters nmemb and size that when

[Chicken-users] What happens to a (non-simple) Scheme object sent to a foreign function?

2007-02-03 Thread Tony Sidaway
I'm sending a Scheme string to a foreign (C) library as a c-string. I also send it the address of a Scheme procedure created as define-external--this address is sent as a c-pointer. Later on I call a safe-foreign-lambda which will use the Scheme function whose address I sent it as a callback,

[Chicken-users] read-lines bug and a suggested bug fix

2007-01-30 Thread Tony Sidaway
(read-lines [port [MAX]]) is supposed to read up to MAX lines from the port. Here's an oddity: $ cat test-read-lines.scm (define lines-per-read 5) (let loop ((lst (read-lines (current-input-port) lines-per-read))) (if (null? lst) '() (begin (map (lambda (x)(display

[Chicken-users] Re: read-lines bug and a suggested bug fix

2007-01-30 Thread Tony Sidaway
On 1/30/07, Tony Sidaway [EMAIL PROTECTED] wrote: Thus I suggest that the last line of the procedure (doread) above could be replaced by: ((if (eof-object? ln) (reverse lns)(or (eq? n 0)(reverse (cons ln lns) Sorry that should be ((if (eof-object? ln) (reverse lns

[Chicken-users] Re: read-lines bug and a suggested bug fix

2007-01-30 Thread Tony Sidaway
1. I really should test things. 2. I don't use the (do) form in my coding and it shows. 3. The following fix has been tested on the sample data. ((if (eof-object? ln) (reverse lns)(or (eq? n 0)(reverse (cons ln lns) ___ Chicken-users mailing list

[Chicken-users] Re: read-lines bug and a suggested bug fix

2007-01-30 Thread Tony Sidaway
Nope. This is what I meant to post. ((or (eof-object? ln) (eq? n 0)) (if (eof-object? ln) (reverse lns)(reverse (cons ln lns ) ) ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users

[Chicken-users] easyffi and gtk

2007-01-28 Thread Tony Sidaway
I'm trying to do basic stuff with easyffi and gtk. Just some basic sanity checks. A very simple program that instantiates a toplevel window and terminates. $ cat window.c #! #include gtk/gtk.h # (g_type_init) (gtk_window_new GTK_WINDOW_TOPLEVEL) Compilation: $ csc -v -X easyffi window.scm -C

[Chicken-users] Chicken on Wikipedia

2006-03-20 Thread Tony Sidaway
I wrote this stub article a couple of days ago and it has expanded somewhat today. http://en.wikipedia.org/wiki/Chicken_Scheme_compiler I've concentrated on the design, which I think is the most remarkable thing about Chicken. To support this I also created an article on the garbage collection