Getter for no field Takashi Kato (07 Sep 2015 12:16 UTC)
Re: Getter for no field taylanbayirli@xxxxxx (07 Sep 2015 12:49 UTC)
Re: Getter for no field Takashi Kato (07 Sep 2015 13:05 UTC)
Re: Getter for no field taylanbayirli@xxxxxx (07 Sep 2015 13:38 UTC)

Re: Getter for no field taylanbayirli@xxxxxx 07 Sep 2015 13:38 UTC

Takashi Kato <xxxxxx@ymail.com> writes:

>> The symbol * is reminiscent of pointer dereferencing in C so it might be
>> a good choice.  Others I can think of are #f or #t, but that doesn't
>> make too much sense to me.  I like * more...  Thoughts?
>
> Sounds good to me but not sure is there anyone using '* as a field name of
> records. (It's not practical but theoretically possible.)
>
> I've just noticed (silly me) that I needed to create 2 wrapping procedures
> for box like:
>
> (define (bref box _) (unbox box))
> (define (bset! box _ value) (set-box! box value))
>
> Then register them using SRFI-17 and the register-getter-with-setter!
> procedure.
>
> It might be better to mention this type of use case.

It's fine if they use * for a field name.  It would be mildly confusing,
but there's no real conflict.  If they care, they can give their record
type a different field name.

I just added box support to the spec and sample implementation.  It will
be in draft #9.

I also fell for the wrapper mistake while implementing it. :-)

Thanks for the idea!
Taylan