r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

[unknown: 5]
17-Feb-2008
[9104x4]
Yeah I don't see a need for a true function only a false function.
Anyone know of a bug in REBOL where the word "end" shows up in a 
list! of values?  I have got this weird problem where the word "end" 
shows up in what should be a list! block of nothing but integers 
but instead I have integers and a few references of the word "end" 
without the string as it is not a string datatype.  If I do a foreach 
and attempt to step through each item it crashes on that entry.  
I can't determine what datatype it is.  I looked at my code and nothing 
in my code or the data it handles contains the word "end".
I did some more research and it appears that the "end" I seen is 
a datatype.  I didn't even know there was an end! datatype.
here is what the list block looks like for example:


== make list! [1 4 5 end unset 6 7 8 9 10 11 12 13 14 15 16 17 18 
19]

except it is a lot longer


I'm not sure why I'm getting the unset! or the end! datatypes at 
this point.  I only use insert to add to this list and all the values 
being inserted should be integer datatypes.
Geomol
17-Feb-2008
[9108]
You could test, if what you're inserting actual is an integer. Something 
like:

if integer! <> type? value-to-insert [print ["Not an integer:" value-to-insert]]
[unknown: 5]
17-Feb-2008
[9109]
I actually did that and it got no errors which really has me a bit 
stumped.
Geomol
17-Feb-2008
[9110x2]
That's weird. Could you test, if the just inserted value in the block 
is not integer!? Like:
if integer! <> type? first blk [print "something"]
And do that for every insert.
[unknown: 5]
17-Feb-2008
[9112x3]
Well that is actually how I did my test.  I had the following in 
the subject area of the problem:


if not integer? record-number: first to-block raw-record [print record-number]

Problem is that it never printed anything
Maybe someone can tell me what the end! datatype is used for and 
that might help find the problem
Gonna go see if the core manual refers to the end! datatype.
Geomol
17-Feb-2008
[9115]
end! is the datatype used to specify ends of blocks, if I remember 
correctly.
[unknown: 5]
17-Feb-2008
[9116]
I didn't even know there was one.  In what way would it be used?
Geomol
17-Feb-2008
[9117x3]
Yes, "internal marker for end of block"
It's an internal datatype.
My guess is, that somehow your input is an empty block (or the end 
marker) in some situations.
[unknown: 5]
17-Feb-2008
[9120x3]
Hmm... ok then that might explain something.   I recall a copy function 
I had that caused the interal code of REBOL to spill out so I assume 
it has something to do with my port handling as that copy function 
I had did similiar.
So it might be in the area where I have a copy/part on file data 
which would result in a block.
Geomol where did you get that information as it being an internal 
marker for end of block?
Geomol
17-Feb-2008
[9123x2]
R3 datatypes: http://www.rebol.net/wiki/Datatypes
Many are the same in R2.
[unknown: 5]
17-Feb-2008
[9125]
ok thanks.
Geomol
17-Feb-2008
[9126]
I think, end! was hidden in R2 and will be exposed in R3.
[unknown: 5]
17-Feb-2008
[9127x4]
I suppose so.  Maybe Gabriele will be lurking and can provide more 
info.
I suppose the end! datatype isn't really interal code as I understood 
internal code in REBOL.
It appears possibly to do with the sort function
You can see the problem here - as it only seems to appear when the 
sort function is introduced:

>> head dbrecs

== make list! [1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 
22 23 24 25 26 27 28 29 30
 31 32 33 34 35 36 37 38 39 40 41 42 43 ...
>> length? head dbrecs
== 10098
>> dbrecs
== make list! []
>> find head dbrecs end!
== none
>> sort head dbrecs

== make list! [1 4 5 end unset 6 7 8 9 10 11 12 13 14 15 16 17 18 
19 20 21 22 23 24 25 26 2
7 28 29 30 31 32 33 34 35 36 37 38 39 40...
>> find head dbrecs end!

== make list! [end unset 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
21 22 23 24 25 26 27 28 2
9 30 31 32 33 34 35 36 37 38 39 40 41 42...
Geomol
17-Feb-2008
[9131]
What do you see, if you do a
>> ? system/version
[unknown: 5]
17-Feb-2008
[9132]
>> system/version
== 2.7.5.3.1
Geomol
17-Feb-2008
[9133]
Have you checked the bug database, if it's a known issue?
http://www.rebol.net/cgi-bin/rambo.r
[unknown: 5]
17-Feb-2008
[9134]
If it is the sort function then that would explain why putting the 
checks in my script didn't catch it because I was only using the 
sort in the console to test some other ideas.
Geomol
17-Feb-2008
[9135]
(Just click the link, I gave, to run the bug database in your browser.)
[unknown: 5]
17-Feb-2008
[9136]
I just searched it and didn't find mention of this problem.
Geomol
17-Feb-2008
[9137]
This is related, I think: http://www.rebol.net/cgi-bin/rambo.r?id=3761&
[unknown: 5]
17-Feb-2008
[9138x8]
Possibly.
But that one says its built already so there is still a problem that 
exists with the function.
I'm going to run another test real quick to see if it effects just 
the list datatype by converting to block before the sort
Ahhh - the problem goes away if I convert my list to a block datatype 
before the sort.
So sort is causing the problem when performed on a list datatype
Do you know of any mezzanine functions that utilize sort?
Is there a version 2.76?
2.7.6 rather
Geomol
17-Feb-2008
[9146x2]
Different versions: http://www.rebol.net/builds/031/
Sort scripts: http://www.rebol.org/cgi-bin/cgiwrap/rebol/search.r?find=sort&form=yes
[unknown: 5]
17-Feb-2008
[9148]
Yeah I don't see any hint of a version 2.7.6 in that list but I seen 
in the Rambo database a reference to one problem being fixed in version 
2.7.6.
Henrik
17-Feb-2008
[9149]
There is an internal alpha of 2.7.6 that has not been released and 
I don't think RAMBO yet shows all the bugfixes for 2.7.6. Carl doesn't 
want to spend too much time on it, so Maarten is appointed release 
manager for it, as he was with R3 alpha 1.
[unknown: 5]
17-Feb-2008
[9150]
so does this mean that 2.7.6 may never get released and instead just 
R3?
Henrik
17-Feb-2008
[9151]
I hope not :-) I need some of those fixes for R2.
[unknown: 5]
17-Feb-2008
[9152]
I don't mind the problems as long as they are being fixed for R3.
Henrik
17-Feb-2008
[9153]
I have production systems that will not be migrated to R3, so I hope 
they will be fixed.