« first day (1579 days earlier)      last day (2201 days later) » 

8:24 AM
@earl Added my 0.02 to the forum post above --^ present state of thinking
 
8:42 AM
@HostileFork In my book #"a" = "a" would entail 1 = #{01} and 1 = [1]. I think all three of those are mistakes.
An apple is not the same as a basket containing one apple. I think it is important to understand that distinction and cater for it accordingly.
I have taught Rebol (and other languages with separate string and character types) long enough, to know that the lack of equality between a character and a single-element string of the same character is one of the topmost minor trip-ups for beginning programmers.
However, from that experience I also know that this is just as quickly overcome.
It is also my belief that in a dynamically type-checked language such as Rebol, actually implementing that equality (#"a" = "a") does more harm than good, over the long term.
Unfortunately, there is hardly any research into the "usability" and "robustness" effects of this design choice that I am aware of.
 
9:02 AM
@MarkI Ok, then sorry for the previous brevity :)
I was indeed trying to show that MOLD and MOLD/all produce different results in this case.
MOLD produces something that needs evaluation to actually construct the wanted value.
Therefore, to construct the desired object, the effects of evaluation need to be catered for, hence MOLD renders the word! value as a lit-word!.
 
9:18 AM
MOLD/all produces something that is actually syntax (for a while now, these #[..] things have been called "construction syntax"), so doesn't need any evaluation to construct.
Therefore: no lit-word escaping necessary.
Now all that you have figured out by yourself by now :)
Now to the hairy part: obviously, there is an inconsistency here between words and paths.
>> mold make object! [a: 'b c: 'd/e]
 
; Brought to you by: try.rebol.nl
== {make object! [
    a: 'b
    c: d/e
]}
 
>> make object! [a: 'b c: d/e]
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-no-value.html
    *** ERROR
** Script error: d has no value
** Where: make
** Near: make object! [a: 'b c: d/e]
 
And with our newly-gained understanding, it's now trivial to see where the bug is.
In MOLD there is some hackery in place to do the above escaping. Obviously, that escaping path! values is also necessary, was forgot about.
@MarkI So there's your answer. Yes, if word! values are turned into lit-word! values by plain MOLD, then the same should be done for path! values (turn them into lit-path!). That this is not done, is a bug.
I just quickly checked our CureCode bug database. Can't find any previous report, so congrats on discovering a new bug :)
 
10:05 AM
@earl I think there is a large difference between #"a" = "a" and 1 = [1] due to the constraints of the space. In one case you're talking about an arbitrary container of symbols, in the other you're talking about something that can only contain the type you are mentioning. I'd say that 1 = #{01} also falls a bit afoul of that same rule because the domain of integers is wider than the domain of single element binaries.
 
10:17 AM
@HostileFork Granted, there is an argument about homogeneous vs heterogeneous containers that can be made here. I don't think it is very strong, though.
I think an argument about invariants and their violation is much more forceful.
 
@earl Well, you've got a long way to go on that one. I think that the goal is a more "natural programming" while avoiding bugs. Other languages have it much worse, and even if you are explicitly being verbose and saying "=="
 
Some other languages have it worse, some have it much better.
 
I don't think with this idea you have it any worse off than other places, and it gives you "a" == #"a" as false as well as #"a" == #"A" as false
Stricter people use a stricter operator.
 
As mentioned, I think making an exception for "atomic value compares equal to a container with just a single element of the same value" just for chars and strings is not very compelling.
 
"In my class, you will use ==."
 
10:23 AM
If you don't have 1 = [1] as well, then you not only increase error potential but also add a striking inconsistency, in my book.
 
Reasonable I guess. As you say, the precise understandings of impact haven't been given a chance to be studied.
 
I also believe, that trying to write #"a" = "a" and expecting it to work actually comes from a lack of understanding.
I think having this be an error that is required to be overcome is far more educational and helpful in the long term, than sweeping the difference under the rug.
 
Well, people should know more about the details of floating point. If you say close-but-not-equal values are equal, they're not really learning IEEE754 and learning to control their epsilons.
They'll get bit later on, somewhere.
 
Yes, in fact I generally agree with that sentiment.
In a simpler vein, I don't think that 1 = 1.0 is a particularly good idea.
Problem with floating point, where it is quite different to e.g. chars and strings, is that doing floating point right becomes extremely complicated.
 
@RebolBot
foo: "abcd"
insert foo "x"
probe foo
insert foo #"y"
probe foo
probe #"y" = take foo
probe "x" = take foo
 
10:28 AM
; Brought to you by: try.rebol.nl
"xabcd"
"yxabcd"
true
false
== false
 
Where you gain some educational advantage, maybe, I say you also create a system that is unnatural and I make mistakes with this too, if I ever work with characters...and I know C++. But in C++ type checking has my back.
 
It doesn't strike me as particularly unnatural, no.
But "natural" is always a very subjective argument anyway, unfortunately.
 
I still say that the division lets people choose their side of the fence
 
Not really, that division between equality operators presupposes knowledge and familiarity of both.
 
== vs =, and perhaps if in Rebol it were already case-sensitive by default I wouldn't lean this way and say "okay, we need ~= for people who want an indirect comparison"
Teach == first then.
People won't think much of it.
Other languages use ==.
 
10:32 AM
Also, == currently has some other traits, which make it rather less preferable as the default operator. But there's a CC ticket for this.
Other languages also use FOREACH.
Rebol is rather fond of its =, so even if some teach ==, you will still see = in code a lot.
 
As I say, I'd be more sympathetic to saying "learn to use imprecise equals if you want imprecision" if I thought there were high odds of case sensitivity making it in.
I find it hard to think = can mean anything but "natural equals" where natural is loose and follows the rule of computing where things should "do what people expect". I mentioned those studies about sending people to a box and telling them "bring me back anything that isn't an apple or a pear"
And everyone brings back an orange, no one a pear.
 
Problem is that "do what people expect" varies widely from one person to the other.
Has always been with those "natural" claims.
 
You can try and retrain people, but in language that is not statically type checked people (myself included, not dumb) will write if "a" = first str [ ... ] and then puzzle about why "abc" isn't running the condition.
It's hard to say where more bugs would come from, because if you wind up getting in a state where you assign something and expect it to be another type, and then look at the assigned thing, it jumps out at you
The problem with these equality tests is you're not assigning to something you can look at and go "OH there's the mistake!" So you fumble for much longer than if you assigned something and go "why isn't it what I thought"
 
Yeah, and people will do the same with two variables, and then wonder why the variable containing an an atomic element actually matches a block with just a single element.
These examples have two sides, both of which are ugly and unnatural in some cases.
 
I still am not sure if the block one is solving a problem anyone has or has complained about.
 
10:39 AM
One slightly researched notion is that in dynamically type-checked language, erroring early is generally preferrable, for robust systems.
 
There are various axes of consistency, and I had an argument about why it's different regarding the domain of types tested and the containers. You didn't think that meant much. I think it's something.
A silent failure of an expectation isn't erroring
Anyway, I think these ideas should be given a shot. All of them. The key is more people. So maybe fixing breaking out of loop wrappers should be a higher priority than this debate, so there is something to show users that isn't foundationally broken as an incentive to try the language in the first place... ? :-)
 
That's not how language design works, in practice :)
If only trying such things out and getting some empiric data wasn't so damn difficult.
>> first #{010203}
 
; Brought to you by: try.rebol.nl
== 1
 
>> first "123"
 
; Brought to you by: try.rebol.nl
== #"1"
 
10:44 AM
>> first [1 2 3]
== 1
(Thank you, sleepy RebolBot.)
 
 
2 hours later…
12:49 PM
@HostileFork - have you followed reasoning regarding the comparison operators and related discussion? rebol.net/r3blogs/0218.html
 
 
1 hour later…
2:15 PM
posted on February 26, 2015 by Anton Rolls

Hello, in my Mozilla Firefox browser I have set my default colour preferences thus: background: #333333 text color: #cccccc but the rebolforum website seems only to set the background colour (<TD bgColor=white); the result is low contrast and difficult to read: background: #ffffff text color: #cccccc The solution should be either: 1) Set the background AND the text colour harmoniously,

0
A: How to interpret stats/show in Rebol 3

sqlabIf you use stats without a refinement, you can see the actual memory usage. So comparing memory usage before and after your implementations you can see which one uses less memory. >> stats == 1129824 >> s: make string! 1024 == "" >> stats == 1132064

 
 
3 hours later…
5:36 PM
@earl Thanks muchly for the confirmation.
I am not sure enough to file the bug quite yet, though.
Sure, words and paths can be converted to their lit- form so the object that is made will have the same content as it was molded from.
But, what do you do about object fields that already have lit words or paths in them?
Put out "a: to lit-word! 'b"?
I'm leaning towards yes ...
 
6:24 PM
This always seems to bite me:
@RebolBot
b: []
append b none
append b none
c: []
append c none

print ["c =>" mold c]
print ["copy/part b 1 =>" mold copy/part b 1]
print ["c = copy/part b 1 =>" c = copy/part b 1]
print ["[none] = copy/part b 1 =>" [none] = copy/part b 1]
 
; Brought to you by: try.rebol.nl
c => [none]
copy/part b 1 => [none]
c = copy/part b 1 => true
[none] = copy/part b 1 => false
 
And I can't seem to reason about it, other than it has something to do with binding
or maybe it was unevaluated words
 
6:42 PM
none is only none when it's none
 
7:01 PM
@kealist Yah, that one.
 
@MarkI is there a good way to work around this? I ended up using empty strings instead of none values to make up for it
 
7:26 PM
@kealist Depends on what you mean by good :)
>> [none] = [none]
 
; Brought to you by: try.rebol.nl
== true
 
>> [none] = reduce [none]
 
; Brought to you by: try.rebol.nl
== false
 
I think that's the core of your problem.
BTW I keep having it as well ...
The new way of trying to do this sort of thing uses #.
>> [none] = [#]
 
; Brought to you by: try.rebol.nl
== false
 
7:28 PM
>> [#] = reduce [none]
 
; Brought to you by: try.rebol.nl
== true
 
So, 'none' is the word, and '#' is the value.
Even though the so-called value molds as "none".
>> mold #
 
; Brought to you by: try.rebol.nl
== "none"
 
You could also use construction syntax, but that's a bit awkward comparatively.
>> [#[none]] = reduce [none]
 
; Brought to you by: try.rebol.nl
== true
 
7:31 PM
>> mold/all #
 
; Brought to you by: try.rebol.nl
== "#[none]"
 
When you enter "append b none" you are appending the none! value
 
@MarkI alright, I think I got it. Thank you
Someone explained it to me once before, but I was failing with the #[none] at that time as well
 
@kealist I hope it helps. As I say, I'm still not 100% at this, after over a decade :(
 
Sadly I have probably been at it even longer
 
7:35 PM
Try it again, maybe even try #[none], if anything seems confusing, I can try to help more.
 
>> [none] = append [] 'none
 
; Brought to you by: try.rebol.nl
== true
 
I should have realized that in the reduction, but I think I had never understood how none reduces because it does not appear any differently on the surface
 
@kealist That's the tripping point, for sure.
I just noticed our bot always starts off with a blank line. What's that for? Advertising? :)
 
@MarkI MOLD, unfortunately, is quite often rather misleading. There is a sect of Rebolers who thinks that MOLD/all is preferable roughly 99.9% of the time.
 
7:40 PM
@earl Misleading, perhaps, but at least in this case it loads as it molds!
 
>> type? load "none"
 
; Brought to you by: try.rebol.nl
== word!
 
You sure about that?
>> type? none
 
; Brought to you by: try.rebol.nl
== none!
 
Yes, it loads. But what does it load as ...
Violates a round-tripping property (but then, as Ladislav regularly likes to point out, LOAD and MOLD are not dual).
 
7:43 PM
@earl Oops! What did I say ... I actually meant that make object! [a: none] will load as it molds, referencing our earlier discussion about lit things
Er, wait a minute ...
>> mold make object! [a: none]
 
; Brought to you by: try.rebol.nl
== "make object! [^/    a: none^/]"
 
Phewf!
 
:)
@MarkI Question is if you really have to care about them, or simply let MOLD produce garbage (silently) in these admittedly rather esoteric cases.
Yes, you could provide explicit TO-conversion for these cases, sure.
The slightly more R3-ish approach, though, would be to make use of QUOTE.
>> make object! [a: quote 'b]
 
; Brought to you by: try.rebol.nl
== RESULT is an object of value:
   a               lit-word! 'b
 
>> make object! [c: quote 'd/e]
 
7:46 PM
; Brought to you by: try.rebol.nl
== RESULT is an object of value:
   c               lit-path! length: 2
 
@RebolBot source quote
 
@earl For me, "esoteric" is functionally equivalent to "What your next customer will try"
 
quote: make function! [[
    "Returns the value passed to it without evaluation."
    :value [any-type!]
][
    :value
]]
 
But yes, I agree with using 'quote.
 
@MarkI Agreed. I'm just like @HostileFork in that aspect, I rather quickly think about border cases. And I definitely don't like border cases to fail in weird ways.
 
7:48 PM
@earl And there is some hope that it can reduce user confusion, to not be dead wrong in some cases :)
 
8:06 PM
Made a Latin Markov chain name generator. First generated name? "Fufidillo"
 
In Rebol :) ?
 
@earl Yes
 
Nice
 
May need some more constraints :)
 
Probably :)
 
8:22 PM
@RebolBot delete
 
; Brought to you by: try.rebol.nl
Popiusonius
Siusenusonsiusius
Laciusenius
Rufrenusius
Aebiustidiusonsentius
 
8:44 PM
Working better with longer chains, of course. Need to make other languages now
 
9:39 PM
@earl I've never thought that LOAD and MOLD are dual.
I mean, of course, for values that evaluate to themselves, it is.
But for everything else they can't be, simply because load does not evaluate.
As soon as you put something (not QUOTE something) as an argument to MOLD, it is evaluated.
The closest to duality I've ever gotten, and this is crude, is the following:
X = do mold quote X
Which works for everything but #[unset!]
For that one, and that one only, you need the /all refinement on mold.
I say it is crude because it considers #, #[none!], and none to all be equal.
Because it is comparing at the value level, of course.
 
10:02 PM
I would delete the above post, but it's so hilarious, I'm going to leave it in.
All I have said is "If you type something, then the value you get is what you would get if you typed it in the exact same way."
I can only say, there is no limit to human stupidity ...
It does point out an unset! inconsistency in mold, though. How does the unset value rate a datatype exclamation?
 

« first day (1579 days earlier)      last day (2201 days later) »