« first day (2397 days earlier)      last day (1383 days later) » 

12:10 AM
Hm. I see SELECT/SKIP works differently in Rebol 3 (and Red!) as compared to Rebol 2.
 
12:26 AM
@rgchris for search, maps are much more efficient than blocks (hash vs. linear search)
 
@giuliolunati The alternative to the above would be (to borrow Red's adopted, ugh, syntax): [#(name: foo value: "Bar") #(name: baz value: "Foobar") ...]
Would there really be a difference when doing an iteration, say, of 1000 values: collect [for-each thing this-example-block [if thing/name = 'foo [keep thing/value]]]
I guess I could try it out. Wouldn't MAP! have a higher overhead in this case?
 
@rgchris Oh yes, if you have so few keys blocks are much better.
 
I think somewhere in the region of six to eight keys.
 
12:43 AM
with these number, maps use linear search -- so you should prefer blocks.
I wonder if we need a refinement /odd for select in blocks, for search in odd positions only; so select/odd [1 2 2 3] 2 => 3
 
@giuliolunati SELECT/SKIP [...] 'THING 2 does this. Did something slightly different in Rebol 2 though.
 
@rgchris Oh thank, I didn't know!
So you surely should use blocks.
 
1:44 AM
@rgchris well, we could do multiple tweets saying that the coffee doesn't taste like it's open sourced. Would that help?
 
2:09 AM
@GrahamChiu It's not really coffee-in-the-large, is it?
 
@rgchris I dunno. But it's not open source language development either
What exactly is their reason for using REBol?
Does anyone else have this problem that when you edit text here, it turns the text to be edited white so it's impossible to see?
 
 
1 hour later…
3:25 AM
NAME is STRING! or BLANK!. I want to store as WORD! or BLANK!—before I'd say keep if string? name [to word! name] Now if NAME is BLANK!, I get VOID as a result. I could do either string? name [to word! name][_] or any [if string? name [to word! name] _] except both are less succinct.
 
keep name: attempt [ to word! name]
 
Seems heavy handed.
 
but also short
 
Is also less expressive.
There's no reason in this case that a string would not become a word. I'd prefer to get an error if that were to go wrong.
(I don't much care for ATTEMPT—hides too many sins)
 
a: all [string? a to word! a ]
 
3:35 AM
Interesting—why does ALL return BLANK?
But not IF.
 
>> a: _ all? [string? a to word! a]
 
~r3> a: _ all? [string? a to word! a]
false
 
so use all? if you want a boolean result
 
Good to know. In this case though I need BLANK.
>> all []
@RebolBot delete
TMI.
 
there's been extensive discussion about this ... I think on Trello
and here
 
3:43 AM
Opining in abstract is one thing, cases another.
 
@rgchris yep, tripping over a block of concrete hurts. Not so much on a virtual bollard.
 
I'd think given new behaviour, I'd expect all [false] to return VOID.
 
@rgchris Well, I never really could participate in these discussions .. but once @HostileFork gets off his 2000 mile bus ride I'm sure he will be happy to discuss this.
 
It matters because I'm writing something that I don't want to have to rewrite—I can't use the ALL notation if it's a bug.
 
>> help all
 
3:48 AM
~r3> help all
USAGE:
ALL block

DESCRIPTION:
Short-circuiting variant of AND, using a block of expressions as input.
ALL is a function .

RETURNS: [<opt> any-value!]
Product of last evaluation if all TRUE?, else a BLANK! value.

ARGUMENTS:
block [block!]
Block of expressions. Void evaluations are ignored.
make error! [
[self: code type id message near where file line arg1 arg2]
[
code: 3007
type: Script
id: arg-required
message: [:arg1 "requires" :arg2 "argument to not be void"]
near: [
print do cgidata ??
 
Need to get indents working :)
 
<sigh>
 
Still doesn't make sense.
 
I have no idea why it's giving an error
 
>> help if
 
3:50 AM
~r3> help if
USAGE:
IF condition branch /only /opt

DESCRIPTION:
If TRUE? condition, return evaluation of branch value.
IF is a function .

RETURNS: [<opt> any-value!]
void on FALSE?, branch result if TRUE? or BLANK! if void

ARGUMENTS:
condition [any-value!]
branch [<opt> any-value!]
Evaluated if block or function and not /ONLY

REFINEMENTS:
/only
Return block and function branches instead of evaluating them
/opt
If branch runs and returns void, do not convert it to BLANK!
make error! [
[self: code type id message near where file line arg1 arg2]
 
RETURNS: [<opt> any-value!]
Product of last evaluation if all TRUE?, else a BLANK! value.
 
"void on FALSE?, branch result if TRUE? or BLANK! if void"
 
false is not true, so you get a blank!
 
@GrahamChiu I see that, but it doesn't make sense—is inconsistent.
 
ahh, well if you can make the case, it will be changed
You can even make the PR for the change.
 
3:53 AM
I doubt it—I'd prefer IF returned BLANK :)
I guess it's explained here:
Void ("unset!") Changes on Rebol3 Porting Guide ("Ren-C" branch)
> Legacy Switch => system/options/none-instead-of-voids: true # Rebol2/R3-Alpha >> if true [] ;-- no result >> if false [] #[none!] >> compose [a () b] [a b] >> com...
But something doesn't sit right.
I feel like the opt-out here: compose [a (if false [c]) b] could be: compose [a (either false [c][void]) b]
Wait:
>> either false [true][void]
== _
>> either false true void
== _
This is causing problems too:
>> set [a b] [a b]
== [a b]

>> set [a b] [a]
== [a]

>> a
== a

>> b
== b
I'd expect B to be VOID or at least BLANK.
2
 
4:18 AM
@rgchris yep, but @BrianH used this in the source
so @HostileFork couldn't change it easily. It had to be reverted.
set [a b c ...] [a]
 
Yikes.
 
was used to set all members of the set
 
Ugh.
SET/PAD then.
 
Hostile Fork
Hm, I killed a feature that seems one of those things only @BrianH knew about and used
set [a b] 10 => a is 10, b is 10
The problem with this feature is it's dicey
what if I set [a b] [10]
@rgchris that's an extract from p2p chat. And the relevant PR that followed.
 
4:37 AM
>> obj: make object! [one: 1 two: 2 three: 3]
>> words: words-of obj
== [one two three]
>> values: reduce words
== [1 2 3]
>> reverse values
== [3 2 1]
>> set words values
== [3 2 1]
>> ? obj
OBJ is an object of value:
   one             integer!  3
   two             integer!  2
   three           integer!  1
(Rebol 2)
@GrahamChiu Still doesn't explain why B isn't set though. It's a conscious choice here to say—if the block isn't long enough, B retains its old value.
Looking at that module code, things could go seriously wrong here.
 
5:01 AM
// !!! Should there be a SET/ONLY to allow for `set/only [a b] [10]`
 +        // such that a and b would be set to 10?  Seems to add complexity for
 +        // a case that is not that compelling.
 
I would expect SET/ONLY to set both A and B to [10]
I'd expect SET to work like SET/PAD in this case: set [a b] [10]
Going by wording, SET/PAD was seemingly intended to be used by OBJECTs.
 
When Brian is available I'm sure he'd love to discuss it with you
But he's on a cross country bus with limited internet at present!
 
Am opening a ticket on SET as current behaviour seems buggy.
 
Sounds good
 
Does it make sense otherwise?
 
5:15 AM
well, he said it was a little used feature set [a b] 10 which he killed but then found it affected modules
 
IF is more fundamental though.
@GrahamChiu He's on a bus, what's your expectation in those cases?
 
posted on May 24, 2017 by rgchris

Considering the following case: set [a b] [10 20] set [a b] [30] I would expect B to be BLANK (legacy behaviour) or VOID. However, it appears it is simply ignored: >> b == 20

 
I encountered this while trying to set two words to the outcome of SPLIT which either produced one or two values in a block.
 
all of these changes have been made to allow easier propagation in a chain
 
In the case of IF, I think it's harder.
Inconsistent too if you don't go all-in.
 
5:31 AM
there are variants
like if*
 
Which I suspect would get messy.
>> if true [void]
== _
This is weird when:
>> if false [true]
<void>
IF returning BLANK aids propagation.
And it's inconsistent for if false [] returning VOID while all [false] returns BLANK. And if true [void] returns BLANK where all [void] returns VOID.
 
5:51 AM
Note that I'm not making the argument that VOID values should be allowed in blocks—I just think to avoid contorting the behaviour of IF, the opt-out as in the COMPOSE example should be explicit.
reduce ["Foo" either is-good? ["Bar"] void]
Ok—so REDUCE doesn't like VOID, otherwise point still stands.
compose [(void)]
reduce [void]
 
 
2 hours later…
7:26 AM
@rgchris To me, the void/blank/true/false ergonomics aren't esoteric, they are core to the design, so yes they should be taken seriously. Yet we've been evolving tools for dealing with them. This is where things like having SELECT* emerge as the "truthful" native, wrapped with the SELECT that blankifies voids comes from.
To me, comparing ALL and IF isn't as pertinent as comparisons between CASE and IF.
@rgchris Broad study of the topic has led me to a different conclusion. This different conclusion is across the board. It's why compose [a (switch 1 [2 ['b] 3 ['c]]) b] is [a b], it's why ELSE can work at all, etc.
ALL was designed to be used in conditional slots, while conditionals in conditional slots are rarely useful
What I want us to do is keep calm, keep looking at the use scenarios, and find something that gives someone trying to get the standard CS/orthogonality the reliable foundation they want, while offering the gloss conveniences of historical Rebol. This is where I will point to SELECT* and SELECT as a likely success story, and it did bend things in favor of the historical Rebol.
If we have to switch to something like IF* to get voids, and use ELSE* instead of ELSE, or who knows what, it's on the table. But it needs motivating examples.
@rgchris "if returning blank aids propagation" => "if returning blank destroys information". Again, why do you see IF and ALL as so tightly related instead of being complementary operations you use when appropriate? all [a | b c d] is the "blanking" if a [b c d] you're looking for.
One issue that has been shaping up, however, is that blanks and voids are treated the same in many contexts. This was not always obvious, e.g. that print [_ "hello" _] should act the same as print compose [() "hello" ()], vs coming up with other meanings for blank.
 
8:16 AM
@GrahamChiu Sure I voted back up to minus two. The sheer speed with which those downvotes and anti-comments were placed make me very much doubt about the quality of the SO site alltogether. There is a very negative attitude toward genuine questions asked. And very quick downvotes, very fast referrals to similar questions that are really different, or not found using the terms used in the placed question.
I usually google for answers, and the results on SO I only click if the other links do not satisfy.
 
I"m only looking for a solution .. if a popup is a better solution so be it
 
9:06 AM
posted on May 24, 2017 by @gchiu

@gchiu wrote: See http://chat.stackoverflow.com/transcript/message/37259990#37260398 and also https://github.com/metaeducation/ren-c/issues/518, and https://trello.com/c/9sOtDYcS/86-failed-conditionals-like-if-false-or-while-false-return-no-value-at-all-instead-of-none Posts: 1 Participants: 1 Read full

 
Hmm.
 
9:31 AM
@rgchris did you ever fix that bug when shttpd died on a refresh in OSX?
 
 
1 hour later…
10:49 AM
Very nice regex to Parse compiler in ~350LOC of Red! #PEG #dsl https://gist.github.com/toomasv/58040ccbbfb70150dee90ba0e27b16b8
 
 
4 hours later…
2:33 PM
@HostileFork Is ELSE worth the tradeoffs? For me it doesn't add any expressive value. What is the distinction between ALL and IF?
(not trying to be contrary, it's just I'm facing impediments in some code I'm working on)
@GrahamChiu No, not yet.
For me, IF and ALL are two approaches to expressing similar ends—you'd select the one that better expresses the problem. If they have different outcomes, the choice is more about outcome than expression.
If SWITCH also returns VOID, then you can't chain with IF: if switch something [][something else]
 
3:20 PM
@rgchris You can do that with switch something [] then [] and even switch something [] then [] else []. It does add expressive value, but the reason it can offer expressive value is generalized.
The fact that an interesting piece of information can escape a conditional as a result, as to whether any condition was taken, is something you can use in several ways.
These properties emerged a long time ago, when all [a | if b [c] | d] was seen as wanting b being false to mean that c doesn't contribute to the expression, vs. if b is false the whole expression is false.
A construct like either switch something [...] [...] [...] has a number of drawbacks when compared with switch something [...] then [...] else [...]. Syntactically it's harder to follow, but also it puts a lot of burden on you inside the switch cases regarding how you return true or false things in your branches. You wind up writing switch [a [stuff true] b [other stuff true] ...] when what you want to know is "was any switch case taken"
 
3:42 PM
@rgchris In order to achieve this, we'd have to switch a lot of code to use any? and all?. I simply don't see the overruling symmetry you're seeing, to me ANY and ALL are strong relatives of OR and AND, not IF. The strong relationship between IF is to CASE and SWITCH and conditionals.
You say that all [thing1 thing2]'s behavior for a false thing1 has to be like if thing1 [thing2]'s behavior when thing1 is false. As someone who believes in nice systemic rules, you'd think that if there was a fundamental truism behind it that I would see it. But I don't see that. If anything, I would say that it should do the same thing as thing1 and thing2, but I don't even believe that ... as it's short-circuiting, and infix AND returns a LOGIC!
 
 
2 hours later…
6:02 PM
Not symmetry, consistency. Why would it be wrong to assume you could do this?— all [false false false] else ['this]
if false [] == void
if true [void] == blank
all [false] == blank
all [void] == void
That'll be the source of a few surprises.
I get the similarities of AND -> ALL and OR -> ANY, but operationally I've always thought them more akin to conditionals with AND and OR more useful for bitwise operations than for flow.
If anything, to my mind ALL and ANY are more akin to a filtered DO.
 
 
3 hours later…
9:04 PM
Here's the first poll rebolchat.me/t/new-name-for-this-forum/76 on the naming of the new forum. All suggestions were from @rgchris If you have your own suggestion I'll add it to the poll.
 
posted on May 24, 2017 by @gchiu

@gchiu wrote: Ask Rebol Rebol U RebIT Other 0voters Votes are public. Show results Posts: 1 Participants: 1 Read full topic

 
argg .. forgot again about this. I don't need to post twice.
@rgchris And as far as we know we think it's only on MacOSX ?
 
9:29 PM
@rgchris It's not wrong except that simply isn't what has driven the usage of that construct in practice, and a lot of code would break. We could also make it so that if true [] => false and if false [] => void, and that ELSE treats blanks and voids the same. I've suggested this, as we already have DEFAULT treating blanks and voids the same.
It's a distinct question from whether blanks are conditionally false or not.
 
posted on May 24, 2017 by @gchiu

@gchiu wrote: In Rebol2/3 we had the following conditionals if value [ ] either value [true][false] all [val1 val2 val3 ...] any [val1 val2 val3 ... ] switch val [ val1 [] val2 ...] and switch/default case [ val1 [] val2 [] true []] and case/all while [condition][body] until [block] With ren-c there are some new variations on these, and these can b

 
@HostileFork some of this information needs to be captured where it can be more easily discovered!
 
@GrahamChiu Nothing is set in stone, and it takes people using it and engaging the debates to hammer it out. I've spent more than a little time talking out loud to myself about it (filling pages of chat here), but as usage increases I guess the interest level in the design questions goes up
 
@HostileFork I think that's what's happening now
as we discover things no longer work as they used to do we need a more uptodate porting guide.
I don't recall if we have to use find or find* or select or select* :(
there is mounting confusion in me
 
There shouldn't be if you thought the way things used to be were fine.
Just use FIND and SELECT
You should only have to care about SELECT* if you're interested in a distinction you used to be unable to make.
 
9:41 PM
Well, if you see the discourse topic above, there have been large number of changes
help only helps so much. We need concrete examples if we're not so used to dealing in the abstract
It could be done on the help/doc pages but it seems I'm the only one editing those :(
 
I'm happy to look at concrete examples, but things like compose [a (either condition [thing-i-want] []) b] is the kind of thing I explicitly am seeking to avoid, preferring compose [a (if condition [thing-i-want]) b] to serve that purpose.
 
well, we don't want none in our compose blocks as we had before!
BTW, another question. We have net-log defined in mezz-debug.r which loads before prot-http.r so shouldn't I be able to use it in prot-http.r ?
 
There may be other solutions, perhaps a COMPOSE which boils away blanks and COMPOSE* that imagines blank-means-blank. We have tools in the box that didn't exist before.
 
@HostileFork Sure but there's no definitive site to look at what they mean except by inspecting the commit comments
 
Everything being discussed so far has a trello card
@GrahamChiu I'd think it should work. Note prot-http is loaded by the host, it's not actually mezzanine
 
9:51 PM
>> source exists?
@HostileFork I tried it and it didn't work. Does it need to be referred to as lib/net-log ?
which also didn't work :(
 
@GrahamChiu I'll look
 
It seems some functions are causing errors in the eval service :(
@RebolBot delete
~>> exists? static.red-lang.org/dl/auto/win/red-24may17-ef089e2.exe
connecting to: static.red-lang.org
== true (rebol2)
 
@HostileFork This works two ways though—you get the advantage in compose, but lose the advantage in the regular flow.
 
@GrahamChiu QUERY is returning void apparently.
@rgchris To prove a loss of advantage, let's see some concrete examples that can't be rewritten more elegantly.
 
@HostileFork This is how I came to discuss this. See my example before: keep if string? value [to word! value]
 
9:59 PM
@HostileFork my red-change-log was failing since it couldn't find any binaries!
 
I'd like it to either keep a word or blank.
This is a common idiom for me.
You're suggesting I tack on else _ each time.
I say the compose example would be better served by an explicit VOID.
 
@rgchris Well, you're close with keep to-value if string? value [to word! value], or keep all [string? value | to-word! value].
Remember that voiding has many advantages, for instance append/dup block value if condition [dup-count], where void is not a value a refinement argument can have for instance, to revoke the /DUP
 
Close, but it does take that choice away.
append/dup block value either condition [dup-count] void
(except if/either won't return void)
 
Correct. You'd need EITHER*
I'm afraid the fact that you are very, very used to tacking either branches onto things may cloud your perspective on how much having to do it sucks
Many very common patterns have little bits of matter you want to selectively put into them, else nothing
And the thing about blanks vs voids is that blanks aren't nothing, they're legitimate values, so you wind up with routines having to suppress them or they sneak their way in places they don't belong
It'd be good to look at it holistically, keeping track of the changes you have to make, and then also having a going-over of what parts of existing code can be cleaned up
 
10:17 PM
posted on May 24, 2017 by gchiu

~>> exists? http://static.red-lang.org/dl/auto/win/red-24may17-ef089e2.exe == _ ( ren-c ) ~>> exists? http://static.red-lang.org/dl/auto/win/red-24may17-ef089e2.exe connecting to: static.red-lang.org == true (rebol2)

 
In any case, IF returning void when the condition is false has been around since nearly the beginning of Ren-C. The thing that changed to support ELSE was the blankification of the true case, e.g. so that if true [] would not also return void, but blank, providing enough distinction that ELSE could reliably trust that void meant the condition branch was not taken.
This also allowed IF? (don't care about the result, just did you take the branch or not) to be written in user code as a chain... if void, the branch wasn't taken, if non-void it was taken.
 

« first day (2397 days earlier)      last day (1383 days later) »