Josh Tilles wrote on 04/12/2016 11:23 PM:
I'm writing an implementation of KLambda, a tiny (the "K" stands for
"Kernel") and rather idiosyncratic Lisp.
This is the best URL I found for what I think is KLambda:
http://shenlanguage.org/Documentation/shendoc.htm#Kl
I had expected there to be a way to use Racket's existing features to implement
KLambda.
I'm sure there's more than one way, and some ways I haven't thought of.
For the first shot, I suggest prefixing for one of the namespaces, like
Matthew Butterick suggested. Perhaps slightly better, prefix for both
namespaces, and I think you might catch errors in your early
implementation sooner (i.e., if your implementation ever sees an
unprefixed identifier where you shouldn't, you know it's an error, not
just that it's an identifier from the namespace that didn't get
prefixed. Later, if you start importing from other `#lang`s, absence of
prefixing could be a cue for a different calling convention you need to
use. (Though, if you ever provide from `#lang klambda` to other langs,
you might end up preferring that function namespace be unprefixed, since
that's the more common thing to provide. And then maybe it's easier for
providing to other `#lang klambda` modules, as well, if you only prefix
the *non*-function namespace.) This prefixing is a quick and easy
method, but it might work sufficiently well.
If you don't leverage the Racket binding model by using prefixing or
similar identifier kludge, then I think you have to start maintaining
the model yourself. I wouldn't do that without a good reason (like, if
KLambda's model differed significantly from Racket in ways other than
just being a Lisp-2).
Good luck,
Neil V.
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.