* guile arrays in 1.9 [not found] <E4.00.14188.B16CE8A4@mx14> @ 2010-01-07 15:13 ` Daniel Llorens del Río 2010-01-07 16:29 ` Andy Wingo 0 siblings, 1 reply; 5+ messages in thread From: Daniel Llorens del Río @ 2010-01-07 15:13 UTC (permalink / raw) To: guile-devel Hello, array->list is broken in 1.9.6: scheme@(guile-user)> (array->list #(0 1)) ERROR: Value out of range: -1 Patch for libguile/generalized-arrays.c: 246c246 < size_t i, lbnd; --- > ssize_t i, lbnd; 251c251 < pos += (i - h->dims[dim].ubnd) * inc; --- > pos += (i - lbnd) * inc; Many of the syntaxes from §5.6.7.1 in the manual don't seem to work: #2() gives 'unrecognized object', #@2(1 2 3) does work but the bounds are ignored (??). These both work with 1.8.7. There is a test-suite/tests/unif.c that is mostly unchanged from 1.8.7. It doesn't call array->list. Some of the tests there should fail (e.g. the second test in with-test-prefix fails for me in the REPL) yet check-guile.log says it passes. Is somebody testing/using this stuff? Thanks, Daniel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: guile arrays in 1.9 2010-01-07 15:13 ` guile arrays in 1.9 Daniel Llorens del Río @ 2010-01-07 16:29 ` Andy Wingo 0 siblings, 0 replies; 5+ messages in thread From: Andy Wingo @ 2010-01-07 16:29 UTC (permalink / raw) To: Daniel Llorens del Río; +Cc: guile-devel Hi, On Thu 07 Jan 2010 16:13, Daniel Llorens del Río <daniel.llorens@bluewin.ch> writes: > array->list is broken in 1.9.6: Ooh, I'm definitely the guilty one here. I "cleaned up" this code, with predictable consequences. > scheme@(guile-user)> (array->list #(0 1)) > ERROR: Value out of range: -1 Just pushed a fix. > Many of the syntaxes from §5.6.7.1 in the manual don't seem to work: > #2() gives 'unrecognized object', #@2(1 2 3) does work but the bounds > are ignored (??). These both work with 1.8.7. > > There is a test-suite/tests/unif.c that is mostly unchanged from 1.8.7. > It doesn't call array->list. Some of the tests there should fail (e.g. > the second test in with-test-prefix fails for me in the REPL) yet > check-guile.log says it passes. Could be that the tests are running only with the interpreter, and the bugs that you're seeing only appear when an array is attempted to be serialized out to object code. > Is somebody testing/using this stuff? You are :-)) More seriously, this code has been around for a long time, but it seems I broke it recently. -- http://wingolog.org/ ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <BB.EE.17517.DB5164B4@mx21>]
* Re: guile arrays in 1.9 [not found] <BB.EE.17517.DB5164B4@mx21> @ 2010-01-08 17:41 ` Daniel Llorens del Río 2010-01-09 21:41 ` Andy Wingo 0 siblings, 1 reply; 5+ messages in thread From: Daniel Llorens del Río @ 2010-01-08 17:41 UTC (permalink / raw) To: guile-devel On 7 Jan, 2010, at 17:29, Andy Wingo wrote: > Could be that the tests are running only with the interpreter, and the > bugs that you're seeing only appear when an array is attempted to be > serialized out to object code. Mm, I don't know how to debug that… > You are :-)) Just so… :) More. In 1.8.7: > (array? 1.0) #f > (array? 1) #f However, in 1.9.6: > (array? 1.0) #t > (array? 1) #f This breaks generalized-vector?, because it depends on scm_is_array(): > (generalized-vector? 1) #f > (generalized-vector? 1.0) ERROR: Wrong type (expecting string): 1.0 I think this is a bug and the behavior of 1.8.7 should be kept, i.e. (array? 1.0) should be false. In fact, I have code that depends on (generalized-vector? 1.0) being false. But scm_is_array() calls scm_i_array_implementation_for_obj() and I don't understand that function. Thanks, Daniel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: guile arrays in 1.9 2010-01-08 17:41 ` Daniel Llorens del Río @ 2010-01-09 21:41 ` Andy Wingo 2010-01-09 23:22 ` Daniel Llorens del Río 0 siblings, 1 reply; 5+ messages in thread From: Andy Wingo @ 2010-01-09 21:41 UTC (permalink / raw) To: Daniel Llorens del Río; +Cc: guile-devel Hi, On Fri 08 Jan 2010 18:41, Daniel Llorens del Río <daniel.llorens@bluewin.ch> writes: > On 7 Jan, 2010, at 17:29, Andy Wingo wrote: > >> Could be that the tests are running only with the interpreter, and the >> bugs that you're seeing only appear when an array is attempted to be >> serialized out to object code. > > Mm, I don't know how to debug that… It's the difference between: scheme@(guile-user)> #2() ERROR: assemble: unrecognized object #2() And: scheme@(guile-user)> ,option interp #t scheme@(guile-user)> #2() $1 = #2() > However, in 1.9.6: > >> (array? 1.0) > #t This was an interesting bug (see commit c5f171027d9 if you are interested). I fixed this one on the 29th; so you see, someone else seems to be using this stuff too :) > I think this is a bug and the behavior of 1.8.7 should be kept, i.e. > (array? 1.0) should be false. Yes, that was just a bug (albeit a strange one). Regards, Andy -- http://wingolog.org/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: guile arrays in 1.9 2010-01-09 21:41 ` Andy Wingo @ 2010-01-09 23:22 ` Daniel Llorens del Río 0 siblings, 0 replies; 5+ messages in thread From: Daniel Llorens del Río @ 2010-01-09 23:22 UTC (permalink / raw) To: Andy Wingo; +Cc: guile-devel On 9 Jan, 2010, at 22:41, Andy Wingo wrote: > scheme@(guile-user)> ,option interp #t Aha, thanks. > This was an interesting bug (see commit c5f171027d9 if you are > interested). I honestly don't know enough of the internals of Guile to comment, but I appreciate the pointer. > I fixed this one on the 29th; so you see, someone else > seems to be using this stuff too :) Sorry if I implied otherwise! It's true that I don't follow the development of Guile close enough. There has been so much progress recently —although that's precisely what draw me to 1.9. Thanks, Daniel ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-09 23:22 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <E4.00.14188.B16CE8A4@mx14> 2010-01-07 15:13 ` guile arrays in 1.9 Daniel Llorens del Río 2010-01-07 16:29 ` Andy Wingo [not found] <BB.EE.17517.DB5164B4@mx21> 2010-01-08 17:41 ` Daniel Llorens del Río 2010-01-09 21:41 ` Andy Wingo 2010-01-09 23:22 ` Daniel Llorens del Río
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).