[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Export a defstruct - Short Version?
From: |
Christian Kellermann |
Subject: |
Re: [Chicken-users] Export a defstruct - Short Version? |
Date: |
Sun, 14 Dec 2014 09:39:18 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
* Bahman Movaqar <address@hidden> [141213 22:29]:
> This code obviously doesn't compile because the export list is wrong
> --if I change the export list to, for example, (make-point) it compiles
> fine.
>
> I'm aware a "defstruct" is basically a shortcut to create a bunch of
> functions and the standard way to export it is exporting all the
> functions one by one. Now, I'm wondering if there is an easier/shorter
> way to do this (something like a wild card)?
No there isn't. There's a wildcard for exporting all symbols in a
module, i.e. using a * instead of a symbol list. For records there's
no such thing I am afraid. A lot of modules don't export some if
not all accessors to hide the actual implementation.
So for the time being you need to explicitly export the getters/setters
and the make- procedure unless you want to provide your own (maybe
with your application specific checks).
HTH,
Christian
--
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.