[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [dev-serveez] switching to guile

From: Raimi 'Raimi' Jacob
Subject: Re: [dev-serveez] switching to guile
Date: Wed, 3 Jan 2001 20:29:56 +0100 (CET)

On Wed, 3 Jan 2001, Martin Grabmueller wrote:

> > From: "Raimund 'Raimi' Jacob" <address@hidden>
> > Date: Tue, 2 Jan 2001 17:30:55 +0100 (CET)
> > 
> > i just had a look at the public guile c interface. i still dont have a
> > good idea on how to provide serveez' functionality in a guile/scheme
> > program.
> To which documentation are you referring?


> Guile supports hash tables, but not the read syntax I implemented for
> Sizzle.  Unfortunately, it is not easy to define such a read syntax in
> Guile, because #{...}# is an additional read syntax for symbols.  A
> solution would be to change Sizzle's hash syntax from #{bla => 1} to
> #[bla => 1].

I dont really care for sizzle / guile syntax compatibility. I just want a
syntax that is non-schemer understandable.

> Internally, hash tables in Guile are implemented similar to Sizzle:
> They are simply vectors with association lists as elements, and the
> hash functions use hash values of the key objects to decide which
> vector slot is to be used for storing/reading the key/value-pairs
> from.

OK... as long as i can traverse them from the C end...

> Such a `hashmap without hash' is called an association list (or alist
> for short) in the Lisp world.

Ha... they all use hot water for cooking :-)

> A schemey way to do this would be to create a server object with a
> procedures like `make-server' (or similar name), bind it to a variable
> name and then register it with Serveez:
> (define foo-server (make-server 'foo "foo-server1" '((bar . 100)
>                     (reply . "booo"))))
> (register-server! foo-server)

ugly because of 2 lines

> (register-server! #:type 'foo #:name "foo-server1" #:bar 100 #:reply "booo")

Ok, that's better. But not really. The syntax for hash creation sucks. I'd
rather use alists than that [syntax].

> Well, I like the more Scheme-like approach I sketched out in this
> post, but probably you would rather like to stick to the old syntax of
> Sizzle and the hashes.  Tell me what you think about this stuff, and
> maybe we can come up with a solution. 

I want the server name and the server type seperate from the actual
configuration hash. I still like

(define-server! "server name" "server type" <some good syntax for a

i'd also rather call it define-server than register-server. doesnt sound
that coder-tongue.
define_server would be a scheme-callable c routine getting 3
arguments: server name, type and a hash/alist of things that are copied
into a struct. i suspect that can't be that hard.
and again, i currently dont care for sizzle/guile syntax compatibility for
our config file.

> Of course, there is still the problem with Guile on Windoze.

I hope that the guile people are willing to accept patches from ela. he
made sizzle work on windoze, so he can make guile [core] work on windoze,
too (i'll help him, of course).
if guile is not to be run on windoze (perhaps if RMS objects
heavily) we wont switch to guile. besides, guile not running on win32
violates the 'u' in guile, IMHO.

Bye for now

... who forgot to copy .signature to this machine...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]