bugKawa - Bugs: bug #49866, make-vector default elements...

 
 

bug #49866: make-vector default elements #!null v #!undefined

Submitter:  Sudarshan S Chawathe <chaw>
Submitted:  Fri 16 Dec 2016 04:53:13 PM UTC
   
 
Category:  Scheme language Severity:  3 - Normal
Item Group:  Unexpected result Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 18 Dec 2016 09:30:35 PM UTC, comment #1: 

I agree the default should be #!null (and not #!undefined).
One reason is to match the default for creating a native Java array.
I checked in the fix.

Per Bothner <bothner>
Group administrator
Fri 16 Dec 2016 04:53:13 PM UTC, original submission:  

The Kawa docs indicate that (make-vector 3) and similar should yield a
vector with #!null elements.  However, it seems the elements are
#!undefined instead:

  chaw@vereq:~$ uname -a
  Linux vereq.eip10.org 3.16.0-4-686-pae #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) i686 GNU/Linux
  chaw@vereq:~$ kawa --version
  Kawa 2.2 (revision 9049M)
  Copyright (C) 2016 Per Bothner
  chaw@vereq:~$ kawa
  #|kawa:1|# (display (make-vector 3))
  #(#!undefined #!undefined #!undefined)
  #|kawa:2|#

I realize that R7RS permits arbitrary elements in such uninitialized
vectors but the Kawa docs do seem to provide a guarantee of the elements
being #!null.

For some context, the reason I got into this detail is that I was
looking for a way to refer to a Java null in Kawa without using the
#!null syntax.  Reason for that, in turn, is that I'm trying to write a
portable library and Guile uses #!...!# syntax for block comments.  I'd
be grateful for other suggestions in this regard too.  (I know Guile
permits overriding the #foo syntax, but I was hoping to avoid messing
with reader syntax.)


Sudarshan S Chawathe <chaw>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Updated the item)
  • -email is unavailable- added by chaw (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-01-16 bothner Open/ClosedOpen Closed
    2016-12-18 bothner StatusConfirmed Fixed
    2016-12-18 bothner StatusNone Confirmed
        Assigned toNone bothner

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code