unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Cc: bug-guile@gnu.org
Subject: Re: stack overflow equal? values
Date: Fri, 19 Jan 2007 09:42:17 +1100	[thread overview]
Message-ID: <8764b4aree.fsf@zip.com.au> (raw)
In-Reply-To: <87sle8ebld.fsf@laas.fr> (Ludovic Courtès's message of "Thu, 18 Jan 2007 13:57:50 +0100")

ludovic.courtes@laas.fr (Ludovic Courtès) writes:
>
> I propose the following simple fix.  Ok to apply?

Yep, looks good.

After I posted I wondered if the values struct is an actual "s" or if
there's some strange extra I couldn't spot.  Testing eq avoids
worrying about that.

Dunno why values are a struct and not a smob cell.

> Actually, `scm_i_struct_equalp ()' should also compare the "tail
> elements" (when there are tail elements),

Yes.

> but their semantics are a
> little fuzzy to me.  In particular, I don't understand why the size of
> the tail array can be specified in both `make-vtable-vtable' and
> `make-struct': What does that mean?  Which one should really be taken
> into account?

Dunno :).

> It seems that the code is a bit unclear on this too:
>
>   guile> (define v (make-vtable-vtable "pr" 0))
>   guile> (define s (make-struct v 123))
>   guile> (struct-ref s 10)
>   Segmentation fault

A segv is a bug, obviously, whichever way it's actually meant to be.

> (Looks like the API is so complex that few people actually bothered to
> use it to its full extents.  ;-))

The records level is friendlier I guess.  For a long time I couldn't
understand what "vtable" meant, I still don't think I quite do.  Maybe
the docs should be tweaked, to help show what structs are typically
meant to be.

> --- orig/test-suite/tests/structs.test
> +++ mod/test-suite/tests/structs.test
> @@ -82,12 +82,18 @@
>         (set-owner! ball "Bill")
>         (string=? (owner ball) "Bill")))
>  
> -  (pass-if "equal?"

You can make a with-test-prefix group if you like.  An exercise of an
actual values too will be good, maybe in eval.test.


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


  reply	other threads:[~2007-01-18 22:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16 16:57 stack overflow equal? values Marco Maggi
2007-01-17 23:32 ` Kevin Ryde
2007-01-18 12:57   ` Ludovic Courtès
2007-01-18 22:42     ` Kevin Ryde [this message]
2007-01-19  9:19       ` 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=8764b4aree.fsf@zip.com.au \
    --to=user42@zip.com.au \
    --cc=bug-guile@gnu.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).