chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH][5] FQN woes


From: lemonboy
Subject: [Chicken-hackers] [PATCH][5] FQN woes
Date: Tue, 9 May 2017 16:20:45 +0200

Hello hackers,
since both `##sys#macro-environment` and `##sys#current-environment`
are alists whose keys are unqualified symbol names it doesn't make
sense to use `var` as lookup key since after the initial lookup of
`var0` against the environment we possibly get back a fully-qualified
symbol thus making the lookup fail.
You can see by yourself by compiling the following snippet with C5:

```
(module foo ()
  (import scheme data-structures)
(define-syntax bar
  (syntax-rules ()))
(set! bar 42)
(set! alist-ref 42)
)
```

When compiled with the patch attached the compiler gives the following
warnings (you need to pass -:d to enable the notices):

Warning: (/tmp/foo.scm:5) - assigned global variable `foo#bar' is syntax
Note: (/tmp/foo.scm:6) - assignment to imported value binding
`chicken.data-structures#alist-ref'

I don't know if the same treatment should be applied to the `keyword?`
test below, if it can be folded inside the `cond` and whether it is a
good idea to turn the notice into a warning but I'm running short on
time :)
I'm happy to adjust the patch according to your feedback here or on irc.

Cheers,
Lemonboy

Attachment: 0001-Use-the-non-qualified-variable-name-in-env-lookups.patch
Description: Text Data


reply via email to

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