chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] retrieving a structure's symbol name


From: Marco Maggi
Subject: Re: [Chicken-users] retrieving a structure's symbol name
Date: Thu, 25 Jul 2019 07:36:04 +0200

Peter Bex wrote:

>>   If I define my  own record-type
>> constructor, and I want to  use the built-in record printers facilities:
>> is  CHICKEN expecting  me  to qualify  the name  with  the module?   The
>> symbols I want to use are expected to be unique...

> No, you can use unqualified symbols.  We still do that in core itself too,
> for SRFI-4 vectors and for ports and so on.  But this is really low-level
> stuff, and there's usually a better way.  What exactly are you trying to
> accomplish?

I am writing a library that mimics R6RS records.  Every R6RS record-type
can  be associated  to a  unique identifier  (UID), which  is a  symbol.
Defining the  same record-type  in multiple modules  is fine,  under the
correct conditions.

  Using the  UID as  struct type  name, and  so implementing  records as
simple CHICKEN structs, seems an efficient way to do it.
-- 
Marco Maggi



reply via email to

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