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

World: r3wp

[RAMBO] The REBOL bug and enhancement database

Maxim
3-Nov-2006
[1943]
linked lists being an exception.
Gregg
3-Nov-2006
[1944]
It obviously doesn't affect much code, though, or we would all be 
screaming about it.
Maxim
3-Nov-2006
[1945]
they are easy to break and fuck up.
Ladislav
3-Nov-2006
[1946x4]
lists will be redesigned for R3 (with my contribution, I hope)
Re the new SWITCH proposal. ( Mezz/switch1.r). It fails in the following 
cases (due to FIND datatype searching properties):

switch-test: func [x] [
	switch :x [
		#[datatype! integer!] ["The first variant"]

  #[datatype! decimal!] #[datatype! block!] ["The second variant"]
	]
]

switch-test block!
switch-test decimal!
(the old SWITCH implementation fails for similar cases too)
I guess it would be useful to have a FIND/LITERAL refinement to behave 
differently when searching for datatypes
Maxim
3-Nov-2006
[1950]
this is my gripe with lists:

>> a: make list! [1 2 3] clear a tail? a
** Script Error: Out of range or past end
** Near: tail? a
Ladislav
3-Nov-2006
[1951]
yes, that is an issue my proposal for lists solves
Gregg
3-Nov-2006
[1952]
I often end up using REDUCE when dealing with datatypes that way.
Ladislav
3-Nov-2006
[1953]
yes, but here the issue is, that FIND does not allow us to implement 
SWITCH reliably
Anton
3-Nov-2006
[1954]
Ladislav, yes, these inconsistencies hold back rebol's reflection 
somewhat.

Maybe it's excusable for ports, though, because they are kind of 
"custom series datatypes"... have to think carefully about that.
Ladislav
4-Nov-2006
[1955]
excusable - the trouble is, that EQUAL? is incompatible even with 
itself this way, not speaking about FIND or SORT. It is too hard 
to implement custom FIND or SORT using "unreliable comparisons".
Anton
4-Nov-2006
[1956x2]
Yes, I agree. I suppose EQUAL? is COPYing the port, what do you think 
? Maybe it's just a minor implementation flaw. Can you see what it 
might be ?
By the way, I found handling all the different datatypes consistently 
very difficult each time that I've launched into doing that. It would 
help development of all sorts of reflective tools if rebol is completely 
consistent and reliable there. Search tools / debugging tools / test 
kits (all that stuff you're probably doing right now.) This is one 
of those core issues which affects so many other higher level tasks, 
it should be ranked High or Critical.
Ladislav
4-Nov-2006
[1958]
my guess is, that it may be "by design", but I don't like it this 
way
Anton
5-Nov-2006
[1959]
I think it may only be a side-effect of an incomplete implementation.
Ladislav
8-Nov-2006
[1960]
user poll: what do you think about RAMBO #3518?
Maxim
8-Nov-2006
[1961]
I do admit that he has a point wrt how the help states things. if 
 there is a stated difference between  '=  and '==   then maybe the 
'= should be expanded (and explicitely documented)  for obviously 
equal values...

like char and one letter string,
$ and equivalent decimal,
 etc.
Ladislav
8-Nov-2006
[1962]
char and one-letter string is not "obvious" for me, but a more "obvious" 
thing may be a comparison of [a] versus (a) or "a" versus %a etc.
Maxim
8-Nov-2006
[1963x4]
isn't a character and "one letter" the same thing semantically?
but in general I am in favor of expanding the equality, as long as 
it does not have side effects like breaking:  if, any, all
I know many people would like to expand these to include empty strings 
and 0, just like python does... but in such a case, many usefull 
uses of any/all will loose their value.
I have considerably reduced useage of if and either since I have 
truely grasped Carl's elaborate and repeated use of any/all
Gregg
8-Nov-2006
[1967]
You have to draw the line somewhere. I think we'd have to discuss 
it on a case-by-case basis, because you can't always substitute one 
value for another, e.g. strings, files, and urls. So, even though 
it seems like two any-string! values could be compared safely, that 
might not work in our favor in real life. We could create a matrix 
and examples for duscussion; I'd be hesitant to change it without 
deeper thought.
Maxim
8-Nov-2006
[1968]
yes obviously, and we could also add a new "loose" equality ~= or 
whatever... but in any case... all matching type-pairs should be 
explicitely explained and documented.
Gregg
8-Nov-2006
[1969]
Agreed.
Maxim
8-Nov-2006
[1970x3]
and we should decide first and foremost if its the intented value 
of the datatype which is consistent or the actual lexical form which 
is the consistent measure.
in some types this will have a lot of meaning/differentiation  ... 
take the date for example... do we equate the number of seconds, 
or the lexical textual form... or both, depending on other type pair...
I think this would be a very nice session/panel for devcon 2007 with 
Carl and Gurus as panel members and any one able to assist and give 
insight.
Anton
8-Nov-2006
[1973x7]
Ladislav, yes, equality is an area lacking clear definition in rebol. 
It doesn't seem to slow day-to-day programming down much, because 
most of the day-to-day requirements were implemented first, but when 
it comes to reflective code it makes everything hazy.
WRT the rambo #3518, I think these just expose "not yet implemented" 
equalities.
In practice, a programmer would notice the failed equality, then 
convert to a datatype which supports the equality operation.
eg:
>> (as-string http://www.rebol.com) = "http://www.rebol.com"
== true
Bug: The size of the H1 is different in these two examples:
view layout/offset [h1 "query:"] 770x50
view layout/offset [h1 "query:"] 760x50
Anyone confirm ? I think it is maybe something to do with H1 and 
size-text.
Maxim
9-Nov-2006
[1980]
hum I don't seem to see any different.. but how would offseting the 
window change the content?
Anton
9-Nov-2006
[1981x2]
Do you see "query:" on one line in both cases ?
Ah.. it's a bug in H1 init.
Maxim
9-Nov-2006
[1983]
the bug I have is that its vertical... in both examples...
Anton
9-Nov-2006
[1984x2]
Compare these four examples:
view layout [h1 "Hello!"]
view layout/offset [h1 "Hello!"] 770x50
view layout/offset [h1 "Hello!"] 760x50
view layout/offset [h1 "Hello!"] 1076x50
Maxim
9-Nov-2006
[1986]
yep, using the layout offset is screwy !
Anton
9-Nov-2006
[1987x3]
print mold svv/vid-styles/H1/init
[
	if :action [feel: svvf/hot saved-area: true]

 if all [not flag-face? self as-is string? text] [trim/lines text]
	if none? text [text: copy ""]
	change font/colors font/color
	if none? size [size: -1x-1]
	xy: size
	if any [size/x < 0 size/y < 0] [
		state: max 1x1 pane-size * 9 / 10 - offset
		if size/x < 0 [size/x: state/x]
		if size/y < 0 [size/y: state/y]
		size: (size-text self) + (edge-size? self)

  + (to-pair all [para (to-pair para/margin) + to-pair para/origin])
	]
	if xy/x > 0 [size/x: xy/x]
	if xy/y > 0 [size/y: xy/y]
]
There you can see state is calculated from PANE-SIZE. There must 
be the problem I think.
Maxim
9-Nov-2006
[1990]
its possible pane-size is 0x0 which would make the text too small 
to fit horizontally... just thinking out loud here...
Anton
9-Nov-2006
[1991]
I'll have to continue this later - time for some exercise...
Maxim
9-Nov-2006
[1992]
its seems to be the same for all text label styles.. like text vtext, 
etc... I guess they are all just styles from the same core face.