« first day (3126 days earlier)      last day (654 days later) » 

1:38 PM
I'm torn on making plain /foo refinements always forced to LOGIC! true or false. I mention in the above post that either way they get "special" treatment. Making them LOGIC! would rock the boat less (use sites arguably intend to get logic). But it makes them different and not fit into the "/optional" schematic, and you lose the information of the name of the used refinement, so then you can't chain as easily.
Having the values (null or /foo (maybe @foo is better?)) vs. (#[true] or #[false]) is a tough call. The former feels mechanically better from the evaluator point of view... unused refinements are always null, you can use the name of the refinement for other purposes. The latter is how nearly every callsite uses no-arg refinements.
 
2:25 PM
posted on May 23, 2019 by @hostilefork Brian Dickens

@hostilefork wrote: As part of Rebol's contention-for-short-names problem, there are many instances where refinements have names like /ALL where they conflict with common natives or lib functions. When this happens, I tend to do something to name them out of the way and put the lib function back: foo: function [ bar [block!] /all "foo all the b

 
 
2 hours later…
4:03 PM
@HostileFork wasn't there some discussion re Red's map! cca one week ago? Seems like Red is making some change. Did you do any changes to the R3's map! type? Any reasoning / discussion to read?
 
4:15 PM
@HostileFork I'm still partial to the traditional notation, copy x some integer! — Parse should have its own consistency and fluency and not try to be more DOish for the sake of it.
 
 
1 hour later…
5:39 PM
@rgchris See rethinking auto-gathered set-word locals. copy let x some integer isn't that fluent. I feel like let x: here makes more sense than let x: some integer! where that doesn't assign x the result of the some integer! rule.
Arguing that PARSE shouldn't use set-word syntax coherently just to be different is like saying you shouldn't make your dialect say From: "Joe" but instead be sender is "Joe".
let x: copy some integer! being the "make a new declaration" form, with x: copy some integer! using an existing binding, seems pretty clear to me.
Really b: some integer! e: is just something that's always seemed wrong to me. b: here some integer! e: here seems better.
 
6:02 PM
In other words, I think set-words-on-the-left-with-expression-being-set-to-on-the-right is Ren-like, not DO-like.
But it is valid to want dialects to look different. I just don't know exactly where the tradeoff is. So consider it in light of what I consider to just be a fact--that auto-gathered set-word! locals are probably a bad idea. So how is that going to be absorbed by PARSE.
 
 
1 hour later…
7:34 PM
@pekr One major distinction affecting maps is that Ren-C splits NONE!/UNSET! into three roles: null (not a value type but falsey, returned as the "soft failure" from things like FIND or SELECT or ANY), BLANK! (a value type like none, also falsey) and VOID! (like UNSET! in that it gives an error on tests for truthiness, but not specifically related to unset variables).
The design of this is purposeful. e.g. replace [1 0 2 0] 0 null (where null is a function evaluating to the null non-valued state) gives you [1 2]. There's no ambiguity as null cannot itself be stored in blocks. Hence in the case of REPLACE it interprets it to mean removal. While replace [1 0 2 0] 0 _ (where _ is effectively what you might think of as #[none]) gives you [1 _ 2 _].
There are far-reaching consequences to how null fits into the system, and to understand its differences from VOID! see Why VOID! is not like UNSET! (and why it’s "more ornery"). Among the places that are affected is MAP!, which has a conscious ability to distinguish between a missing map entry and an entry mapping to blank.
I suppose the other major change for maps is that there is a "locked" state which blocks and strings get when they are used as keys. This is irreversible. If you don't want something you use as a key to be locked, then you have to COPY it and use the copy as the key. But it permits you to use blocks as keys in maps, which I feel is important.
 
Seems a bit complicated at first sight :-) I do remember some talk about BLANK!, but not so VOID!
 
@pekr "void" was the initial name for null, and it tried to do double duty by acting as an ornery non-true-or-false state, as well as not being a value you could store in a block. But over time when NULL became "soft failure" (and corresponding to C's null in the API, also falsey in C's if statements) it just made sense for it to be treated as falsey. So VOID! re-emerged, and it pops up in several places you would have wanted UNSET!s historically.
But VOID! is still "a value", you can put it in blocks...a variable being used to enumerate a block has to be able to hold it. That variable is not really "unset", by definition.
 
you can't put unsets in block?
 
There's no unset in this world. NULL can't be put in blocks, so you have to decide on a case-by-case basis what to do with a NULL. In the case of REPLACE, the decision of what to do seems pretty obvious... interpret as a removal.
In the case of a REDUCE, you probably want something in the slot that evaluated to a null, so it should be forced to a VOID! or BLANK!. It depends on how tolerant you want to be.
Since reduce [find [a b c] 'd] is [#[none]] historically, that would suggest REDUCE should decide that a null becomes BLANK!, so [_]
Failed conditionals or CASE or SWITCH return null, and COMPOSE treats a null as a request to vaporize...which is nice. Vaporization seems the better choice for a COMPOSE when a GROUP! evaluates to null, as opposed to erroring etc.
It's elegant at the C level. REBVAL *x = rebValue("find", haystack, needle); gets back a 0 pointer (a null) if the find fails, so it can just say if (!x) {...}...not worry about freeing the handle it gets back.
Curiously things do cross through several points with historical Rebol. e.g. the nature of what happens with if true [] vs. if false []... the former yielding an "ornery" value (UNSET! in Rebol2, VOID! in Ren-C) and the latter a "friendly" conditionally false value (NONE! in Rebol2, NULL in Ren-C).
 
8:02 PM
Well, will have to think, it is beyond my understanding, but thanks for your explanations anyway!
 
@pekr Well, Red has had to grapple with the question of how do you remove things from maps...which isn't too much unlike the how to tell REPLACE to actually replace with nothing. If #[none] is something that can legally be put in a block, how can you tell the difference between asking to replace with #[none] and removal? So then you go to #[unset], but it's the same problem again since you might mean to replace with #[unset].
You might say "oh, but #[unset] is an uncommon value"...well it may have been, but then once you start saying that replacing with #[unset] is how you clear things out of maps, it becomes common. So you really just start following down the same path again.
You'll always have some form of meta-problem, but NULL imposes a kind of hard stop on it and informs the design so people know where the decision points are.
 
8:44 PM
> "Vladimir Vasilyev @9214 11:48
Well, I have an idea, but I wouldn't call it a "better" one. Like I said, if we want to keep the old map! behavior, it's either unset abusage or creation of new datatype (or maybe redesign of unset) - something that cannot be really stored, loaded or even represented, but can result only from "meaningless" computation. If you set word or path to it or put it somewhere - it either unsets a word or evaporates the key."
It's almost funny watching this in the context of discussion of "maybe we should have...two maps, one that stores nones and one that doesn't?"
 
9:05 PM
> "Weeks of coding can save you hours of planning."
 
9:36 PM
The refinements-as-argument resolves issues that were annoying before. Such as, there was throw/name value the-name. There was a note wondering if it should be called throw/named so that the name argument could be called name, which was taken by the refinement being called /name. Now it's just one of those old irrelevant wondering-out-loud notes that can be deleted... because /name is both the refinement and the frame argument that is the name.
 
10:17 PM
posted on May 23, 2019 by hostilefork

There is a note in %sys-load.r regarding a curious problem using the frame-building APPLY that runs and binds arbitrary code (interim name APPLIQUE): a: /self/all ; !!! Some bad interaction requires this, review return map-each s source [ applique 'load [ source: s header: /header all: /a type: /type ] ] It seems thi

 
 
1 hour later…
11:28 PM
posted on May 23, 2019 by @hostilefork Brian Dickens

@hostilefork wrote: When you make a new FRAME! for a function, it has all of its fields unset. foo: function [x [integer!] /y [integer!] /z] [...] >> f: make frame! :foo == make frame! [ x: ' y: ' z: ' ] (Note: While the molding communicating that those fields are null may be imperfect, it's at least an improvement on histo

 

« first day (3126 days earlier)      last day (654 days later) »