[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Some syntax help?
From: |
Dan Leslie |
Subject: |
Re: [Chicken-users] Some syntax help? |
Date: |
Sat, 02 May 2015 19:13:55 -0700 |
First off, thank-you for the aid!
Peter Bex <address@hidden> writes:
> I'm sorry to say it, but this egg contains a lot of strange mistakes and
> weird things; for example, the setup-file tries to emit a module named
> "funky", which does not exist. Also, the renaming procedure from
> explicit renaming macro transformers is referred to as "inject", which
> is extremely misleading: that's the _opposite_ of what it does!
Heh, the `funky` was a copy-paste mistake; oops. ;)
The opposite of inject would be extract; can you explain this a little
more? I'll admit, I'm quite confused by Chicken's syntax extensions.
> Finally, defining two modules in one file, and then having only the
> second emitted and installed, which then reexports the former module
> is very confusing, in my opinion. I suppose it works, but I'm not sure
> this is how it's supposed to be used. Feel free to correct me if I'm
> wrong, though!
I pulled this behaviour from one of the srfi eggs; I can't recall
which. I liked the separation between compilation scope for the 'core'
and the ecosystem of methods that build upon it. I agree, it's somewhat
confusing at first glance, but it made catching the problems faster when
I had yet to write any tests. ;)
> I found the code to be extremely (I would say needlessly) complex.
> Because there's so much weird stuff going on, I decided to whittle away
> all the distractions and boil it down to a minimum, correct(!) macro that
> failed. This was what I ended up with in monad.scm:
Besides the definitions, most of what's going on in 'core' is simply to
unroll the chains without rebinding with each step down the chain.
> This makes no sense; this should simply work. After some puzzling,
> I figured out the reason: the setup file declares the extension as
> being purely syntactical, through ((syntax) (version 3.2)) in the
> install-extension's third argument. This causes the compiler to omit
> loading the module body when you compile a program that uses it.
*facepalm*
That would do it, yes. I mistakenly thought that (syntax) would notify
Chicken that the egg contained syntax definitions. :/
Thank-you again! This egg was my first real foray into playing with
Chicken's lower level syntax extensions; and I must say it's been rather
confusing, which seems to have been due to gross misunderstandings on my part.
-Dan
--
-Dan Leslie