unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#18583: possibly buggy top level behavior in master
@ 2014-09-29 13:24 Daniel Llorens
  2016-06-21 20:50 ` Andy Wingo
  2016-06-21 20:51 ` Andy Wingo
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Llorens @ 2014-09-29 13:24 UTC (permalink / raw)
  To: 18583


The following code:

(define-syntax define-lues
  (syntax-rules ()
    ((_ () exp)
     (call-with-values (lambda () exp) (lambda () 'unspecified)))
    ((_ (var . vars) exp)
     (begin
       (define var (call-with-values (lambda () exp) list))
       (define-lues vars (apply values (cdr var)))
       (define var (car var))))
    ((_ var exp)
     (define var (call-with-values (lambda () exp) list)))))

(define-lues (a) (values (make-vector 3 9)))
(vector-length a)

In 2.0, either pasting this in the REPL or (load "...") a file
containing this produces the expected result, 3.

In the current master (f7582), pasting in the REPL produces the
same result, but loading from a file this produces the error:

> In procedure vector-ref: Wrong type argument in position 1 (expecting vector): (#(9 9 9))

I'm aware of the workarounds, I'm reporting the behavior itself.

Regards,

	Daniel






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#18583: possibly buggy top level behavior in master
  2014-09-29 13:24 bug#18583: possibly buggy top level behavior in master Daniel Llorens
@ 2016-06-21 20:50 ` Andy Wingo
  2016-06-21 20:51 ` Andy Wingo
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2016-06-21 20:50 UTC (permalink / raw)
  To: Daniel Llorens; +Cc: 18583

On Mon 29 Sep 2014 15:24, Daniel Llorens <daniel.llorens@bluewin.ch> writes:

> The following code:
>
> (define-syntax define-lues
>   (syntax-rules ()
>     ((_ () exp)
>      (call-with-values (lambda () exp) (lambda () 'unspecified)))
>     ((_ (var . vars) exp)
>      (begin
>        (define var (call-with-values (lambda () exp) list))
>        (define-lues vars (apply values (cdr var)))
>        (define var (car var))))
>     ((_ var exp)
>      (define var (call-with-values (lambda () exp) list)))))
>
> (define-lues (a) (values (make-vector 3 9)))
> (vector-length a)
>
> In 2.0, either pasting this in the REPL or (load "...") a file
> containing this produces the expected result, 3.
>
> In the current master (f7582), pasting in the REPL produces the
> same result, but loading from a file this produces the error:
>
>> In procedure vector-ref: Wrong type argument in position 1 (expecting vector): (#(9 9 9))
>
> I'm aware of the workarounds, I'm reporting the behavior itself.

Thank you thank you thank you for this report!

Incidentally it has a nice reduction, at the REPL or whereever:

  (begin
    (define x (list 1))
    (define x (car x))
    x)

Should be 1, Guile master was giving (1).  The reasons are a bug in the
effects analysis for the `define!' primitive.  I wonder how I didn't
catch this before!  Fixed in master, though sadly with a bytecode
version bump.

Andy





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#18583: possibly buggy top level behavior in master
  2014-09-29 13:24 bug#18583: possibly buggy top level behavior in master Daniel Llorens
  2016-06-21 20:50 ` Andy Wingo
@ 2016-06-21 20:51 ` Andy Wingo
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2016-06-21 20:51 UTC (permalink / raw)
  To: 18583-done

thanks





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-21 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-29 13:24 bug#18583: possibly buggy top level behavior in master Daniel Llorens
2016-06-21 20:50 ` Andy Wingo
2016-06-21 20:51 ` Andy Wingo

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).