Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Dylan > GD/OD incompati...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 211 of 283
Post > Topic >>

GD/OD incompatibility of copy-sequence for the value #f

by "Peter Robisch" <peter.robisch@[EMAIL PROTECTED] > Dec 5, 2006 at 02:58 PM

GD and OD handle a statement like
     let endValue = #f
     copy-sequence(argv, end: splitter);
differently:   
* GD turns the value of the keyword end into the default sequence.size,
if its value is #f
* OD in this situation pops up an run-time error, because it only turns
the constant $unsupplied into the default sequence.size, but not
#f.

OD uses the method check-start-compute-end of the file:

http://www.opendylan.org/cgi-bin/viewcvs.cgi/trunk/fundev/sources/dylan/sequence.dylan?rev=9780&view=log
to turn $unsupplied into the default integer value, which is the size of
the sequence via the line:
   let last :: <integer> = if (unsupplied?(last)) seq-size else last
end;

IMHO if it is acceptable to turn $unsupplied in to the default integer
value, we could also accept #f in all cases where
check-start-compute-end is used and turn #f into seq-size via an
adaptation of check-start-compute-end.

This would allow code like 
   let break = subsequence-position(arg, "=");
   store(copy-sequence(arg, end: break));
Currently for such a code snippet OD pops up a run-time error, while GD
accepts it.

BTW, the DRM states related to copy-sequence that the value of end that
* the value has to be an instance of <integer> and 
* the default is the size of source.
see:
http://www.opendylan.org/books/drm/Collection_Operations#MARKER-2-1796
 
DRM currently does not contain a remark which non-integer value are turn
into the integer default: sequence.size

May be that in this case an improvement to the DRM is also necessary.



I would prefer a line like 

  let last :: <integer> = if (unsupplied?(last) or (last == #f) ) 
                              seq-size 
                          else last end;
in method check-start-compute-end of 

http://www.opendylan.org/cgi-bin/viewcvs.cgi/trunk/fundev/sources/dylan/sequence.dylan?rev=9780&view=log


Why should the value #f be handle other than the value $unsupplied?
Why should not both be turn into the default value of sequence.size ?

 

pet-ro


-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
 




 9 Posts in Topic:
GD/OD incompatibility of copy-sequence for the value #f
"Peter Robisch"  2006-12-05 14:58:33 
Re: GD/OD incompatibility of copy-sequence for the value #f
"cgay" <carl  2006-12-12 10:00:59 
Re: GD/OD incompatibility of copy-sequence for the value #f
"tc" <matthi  2006-12-13 06:43:26 
Re: GD/OD incompatibility of copy-sequence for the value #f
"Chris Page" &l  2006-12-14 18:44:39 
Re: GD/OD incompatibility of copy-sequence for the value #f
peter.robisch@[EMAIL PROT  2007-01-26 01:12:16 
Re: GD/OD incompatibility of copy-sequence for the value #f
peter.robisch@[EMAIL PROT  2007-01-28 12:37:18 
Re: GD/OD incompatibility of copy-sequence for the value #f
Dustin Voss <d-j-v@[EM  2007-03-04 01:47:58 
Re: GD/OD incompatibility of copy-sequence for the value #f
Dustin Voss <d-j-v@[EM  2007-03-04 11:04:03 
Re: GD/OD incompatibility of copy-sequence for the value #f
Hugh Greene <husenet2.  2007-03-06 08:55:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 5:47:27 CDT 2008.