[racket-dev] problem with require and frtime

From: Marijn (hkBst at gentoo.org)
Date: Fri Jan 20 07:45:35 EST 2012

Hash: SHA1

On 19-01-12 14:13, Matthew Flatt wrote:
> The `frtime' language exports an `=' that isn't the same as `=' in 
> `racket', so that's why the pattern doesn't match. (This seems like
> a further weakness of the `frtime' docs to specify the exports 
> precisely.)
> You could avoid bound names like `=' as literals in the macro. 
> Normally, it works best for a form-exporting macro to also export 
> bindings for any literals in the form. Otherwise, this kind of 
> confusion is common.

I think I will change the `=' to `!' for now. What kind of binding
should I use for `?' and `!'? There is no sensible meaning to be bound
to them...
What do you use to bind `else'?

> Alternatively, you may want to match literals in your macro 
> symbolically instead of by binding. You can't do that easily with 
> `syntax-rules', but you can use `syntax-case*' and supply `(lambda
> (a b) (eq? (syntax-e a) (syntax-e b)))' as the literal-comparison 
> function.
> If it were me and I decided to go in the direction of symbol
> equality, I'd use keywords instead --- `#:?' and `#:=' instead of
> `?' and `=' --- which makes clear that there's no question of
> binding.

When cond starts using #:else I might consider this more seriously.
The docs seem now less than clear to me about the difference between a
keyword and a symbol. The reference claims that "A keyword is like an
interned symbol, but ... and a keyword cannot be used as an
identifier" implying that symbols can be used as identifiers.

I have in my head from unknown source (maybe from other schemes) that
a keyword is a value which evaluates to itself, like a constant,
whereas symbols are produced by quoting identifiers. The difference
manifesting when multiple-evaluation comes into play: what is the
value of the value of ...

Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


Posted on the dev mailing list.