unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Klaus Stehle <klaus.stehle@uni-tuebingen.de>
To: Mark H Weaver <mhw@netris.org>
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	11198@debbugs.gnu.org,
	"Klaus Stehle" <klaus.stehle@uni-tuebingen.de>
Subject: bug#11198: problems reading data with a "read-hash-extend" registered reader
Date: Wed, 11 Apr 2012 22:34:07 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.61.1204112213340.10963@commlink.zdv.uni-tuebingen.de> (raw)
In-Reply-To: <87d37e83n7.fsf@netris.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1727 bytes --]

Hallo Mark,

On Wed, 11 Apr 2012, Mark H Weaver wrote:

> Date: Wed, 11 Apr 2012 15:33:32 -0400
> From: Mark H Weaver <mhw@netris.org>
> To: Ludovic Courtès <ludo@gnu.org>
> Cc: Klaus Stehle <klaus.stehle@uni-tuebingen.de>, 11198@debbugs.gnu.org
> Subject: Re: bug#11198: problems reading data with a "read-hash-extend"
>     registered reader
> 
> ludo@gnu.org (Ludovic Courtès) writes:
> > Klaus Stehle <klaus.stehle@uni-tuebingen.de> skribis:
> >
> >> (read-hash-extend #\R read-R)
> >
> > Unlike previous versions, Guile 2.0 has distinct compilation and
> > run-time phases.  Here you probably want the reader extension to become
> > effective at compile-time (when compiling), and at evaluation-time (when
> > interpreting the code):
> >
> >   (eval-when (compile eval)
> >     (read-hash-extend #\R read-R))
> 
> I don't think this will be sufficient by itself, because 'read-R' will
> not yet be bound at compile time.  You also need to define 'read-R'
> within the 'eval-when', and everything else that's needed to run
> 'read-R'.

You are right. But now the record type is unknown at compile time.
So I also wrap the define-record-type expression into an 'eval-when'.

Then we arrive at the same error message which is displayed when
typing the #R-expression interactively:

=> ERROR: build-constant-store: unrecognized object
=> #<my-record one: "bla" two: "bobo">

This error message is not very informative. And in spite of an error the
record is built! You can see it in the error message but you can't use it.

> Alternatively, you could refrain from using the #\R syntax within the
> same file where it is defined.

Not yet tested ...  (soon ...)


Thanks,
Klaus

  reply	other threads:[~2012-04-11 20:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-07 20:16 bug#11198: problems reading data with a "read-hash-extend" registered reader Klaus Stehle
2012-04-09 21:10 ` Ludovic Courtès
2012-04-11 19:07   ` Klaus Stehle
2012-04-11 19:33   ` Mark H Weaver
2012-04-11 20:34     ` Klaus Stehle [this message]
2012-04-22 13:43       ` Mark H Weaver
2012-04-22 18:01         ` Ludovic Courtès
2012-04-24  8:11           ` Andy Wingo
2012-04-24 11:24             ` Noah Lavine
2012-04-24 11:38               ` Noah Lavine
2012-04-24 16:22               ` Ludovic Courtès
2012-07-05  8:00 ` bug#11198: prefab structs in guile Andy Wingo
     [not found] ` <877gui7i3y.fsf@pobox.com>
2012-07-05 20:57   ` Ludovic Courtès
     [not found]   ` <87ipe2dizn.fsf@gnu.org>
2012-07-05 21:06     ` Andy Wingo
     [not found]     ` <878vex534f.fsf@pobox.com>
2012-07-05 21:55       ` Ludovic Courtès
     [not found]       ` <874npldga9.fsf@gnu.org>
2012-07-05 22:03         ` Andy Wingo
2012-07-05 22:06         ` Andy Wingo
     [not found]         ` <87ipe13lya.fsf@pobox.com>
2012-07-05 22:14           ` Ludovic Courtès
     [not found]           ` <87a9zdc0tc.fsf@gnu.org>
2012-11-27 21:52             ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.1204112213340.10963@commlink.zdv.uni-tuebingen.de \
    --to=klaus.stehle@uni-tuebingen.de \
    --cc=11198@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).