chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Variable Capture in message-digest


From: Peter Bex
Subject: Re: [Chicken-users] Variable Capture in message-digest
Date: Tue, 26 Apr 2016 10:40:04 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Apr 26, 2016 at 09:26:55AM +0100, Andy Bennett wrote:
> Thanks Peter!
> 
> That is rather confusing: I thought each module imported its own
> identifiers and had its own namespace.

It does, but the identifiers which you import are simply aliases
for the same thing, so if you set! one, you set! all of them.

It may make more sense if you remember that modules disappear when
compiling; the identifiers all get replaced by their canonical name,
so if you (import (rename foo (bar my-weirdly-renamed-bar)))
it rewrites all my-weirdly-renamed-bar to foo#bar.

Thus, (set! my-weirdly-renamed-bar 42) is equivalent to (set! foo#bar 42)

> As string->blob is part of "library" I'm not importing it from anywhere
> so how would I "except" it?

It's in the "chicken" module, so (import (except chicken string->blob))
should do the trick.  Library is just the unit that defines this module's
identifiers.  Yeah, this is confusing, and weird.  Hopefully we'll fix
this situation with CHICKEN 5, where we'll define the modules more
explicitly, and probably restructure the manual to match.

Cheers,
Peter

Attachment: signature.asc
Description: Digital signature


reply via email to

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