guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Use a fluid for the list of the reader's "hash procedures"


From: Ludovic Courtès
Subject: Re: [PATCH] Use a fluid for the list of the reader's "hash procedures"
Date: Thu, 28 Oct 2010 00:01:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi!

Thanks for the patch.

Andreas Rottmann <address@hidden> writes:

> This is a prerequisite for the patch implementing SRFI-38, which I'll
> post next.
>
>
> From: Andreas Rottmann <address@hidden>
> Subject: Use a fluid for the list of the reader's "hash procedures"
>
> This allows customizing the reader behavior for a dynamic extent more easily.
>
> * libguile/read.c (scm_read_hash_procedures): Renamed to
>   `scm_i_read_hash_procedures'.
>   (scm_i_read_hash_procedures_ref, scm_i_read_hash_procedures_set_x):
>   New (internal) accessor functions for the fluid.
>   (scm_read_hash_extend, scm_get_hash_procedure): Use these accessor
>   functions.
>   (scm_init_read): Create the fluid, named `%read-hash-procedures' instead of 
>   the previous plain list `read-hash-procedures'.

Hmm that’s an incompatible change.  ‘scm_read_hash_procedures’ and
‘read-hash-procedures’ aren’t documented, but they’re public.  The
latter can probably be kept compatible like this:

  (begin-deprecated
    (define %deprecated-read-hash-procedures
      (make-procedure-with-setter
        (lambda ()  (fluid-ref %read-hash-procedures))
        (lambda (v) (fluid-set! %read-hash-procedures v))))

    (define-syntax read-hash-procedures
      (lambda (s)
        (syntax-case s ()
          (_ (%deprecated-read-hash-procedures))))))

Nevertheless I’m OK with the patch (plus the above addition), though I’d
like to hear what other people think.

Thanks,
Ludo’.




reply via email to

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