World: r3wp
[RAMBO] The REBOL bug and enhancement database
older newer | first last |
BrianH 27-Oct-2006 [1915] | Petr, there were discussions in the R3 blog about accessors. It's quicker to just look there. |
Pekr 27-Oct-2006 [1916] | I think I understand - it is simply that some "variable" is not variable, but a function? In Visual Objects, we could define variable being an accessor, you then normally used oMyObject:myVar: 3 - which could mean - you either assign it to variable, or (if an accessor), the same syntax is being used, but it was passed as a parameter to function, which could do type checking, whatever ... |
BrianH 27-Oct-2006 [1917] | Yup, something like that. Accessors were introduced in Self, then ported to Delphi (as properties), then from there to ActiveX, Java (as a coding convention), C# (and the rest of .NET), and then many other modern languages and platforms (most of the major ones). |
Maxim 27-Oct-2006 [1918x2] | python is defined from ground up with accessors, you can replace the in-built datatypes!!! |
I guess self is like that also. | |
BrianH 27-Oct-2006 [1920] | Python is designed that way now, but it didn't start that way. That's something I like about Python - when they add new features in a new version, they are not afraid to redesign the whole system to take advantage of the new features. |
Anton 28-Oct-2006 [1921] | Submitted the above crash code to RAMBO. |
Ladislav 3-Nov-2006 [1922x2] | what do you think about these: >> p: make port! http:// >> equal? reduce [p] reduce [p] == true >> equal? p p ** Access Error: Port none not open ** Near: equal? p p or >> a: tail [1] == [] >> remove head a == [] >> equal? reduce [a] reduce [a] == true >> equal? a a ** Script Error: Out of range or past end ** Near: equal? a a |
it looks inconsistent to me and incompatible with FIND and SORT as well | |
Gregg 3-Nov-2006 [1924] | It does look like a problem. Things like this are funny, because it seems like an obvious issue we would have hit long ago. :-\ |
Henrik 3-Nov-2006 [1925] | ladislav, you aren't causing Carl any sleepless nights now, are you? :-) |
Ladislav 3-Nov-2006 [1926] | no, he silently ignores my huge list |
Gregg 3-Nov-2006 [1927] | Except that I don't get the error you get on the second example. |
Ladislav 3-Nov-2006 [1928] | you don't? |
Gregg 3-Nov-2006 [1929x2] | No. Let me try a fresh console. |
Hmm. I got it this time. | |
Ladislav 3-Nov-2006 [1931] | it surprises me you didn't the first time |
Gregg 3-Nov-2006 [1932] | Me too. Let me check something. |
Henrik 3-Nov-2006 [1933] | ladislav, well it could be that he's incorporating fixes into R3. |
Gregg 3-Nov-2006 [1934x2] | Oh well, it happens every time now. Must have been something odd. Can't dupe it right now. |
Can't dupe it working that is. :-) | |
Ladislav 3-Nov-2006 [1936] | that does not surprise me like the opposite did |
Gregg 3-Nov-2006 [1937] | That one comes back to the old issue of out of range indexes, which has been around for a long time, correct? |
Ladislav 3-Nov-2006 [1938x2] | yes, it is an old issue, actually |
but my point is, that you cannot state comparing A with A may be an error without asking for trouble | |
Gregg 3-Nov-2006 [1940] | Agreed. |
Ladislav 3-Nov-2006 [1941] | it is clearly more useful to allow comparisons as FIND or SORT demonstrate than to forbid them |
Gregg 3-Nov-2006 [1942] | I would say that you can't do *anything* safely on a series reference. |
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 [1963x2] | 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 | |
older newer | first last |