« first day (3220 days earlier)      last day (560 days later) » 

12:03 AM
But there are other benefits you might not expect. If you see append x "abc" you know x is an ANY-STRING! for instance. Though as I mention, I think append x ["abc"] should likely be allowed on strings as well...but at least it does give you a bit of an axis to help understand some code better.
    func-r2: reskinned [body [block!]] adapt :func []
    aggregator: func-r2 [x] [data: [] append data x]
    did all [
        [10] = aggregator 10
        [10 20] = aggregator 20
    ]
^-- there is a good example from a test, of a casual APPEND that looks simple at first. But has the author of func-r2 thought about what to do when a BLOCK! comes along? With this new rule, you get an error, because appending to a block expects a block to splice. Now the error cues you to be explicit about your meaning.
Your meaning may be as simple as changing that to append data @x or append/only data x. You may ask to be called as aggregator [10], or maybe ask them for their own /only or modal parameter to say what they mean. Or you may realize you want to be datatype sensitive in some other way. But now you have a safety net. Solving it can be as little as one character.
 
 
2 hours later…
1:51 AM
@giuliolunati I think that we definitely do need a REDUCE mode that vaporizes nulls, and I imagine that the GET-BLOCK! form should. See this weird proposal and tell me what you think...
 
 
4 hours later…
5:48 AM
Here's another wild concept. What if the argument to PRINT is modal, and if you use @ then you get unspaced... and the blank proposal is instituted?
>> print ["a" "b" "c"]
a b c

>> print @["a" "b" "c"]
abc

>> print @["a" "b" _ "c"]
ab c
e.g. PRINT has an /UNSPACED refinement tied to the thing to print as a modal parameter.
I've always had this feeling that blank and space are linked.
@rgchris ^-- If you don't like the symbol, print unspaced ["a" "b" _ "c"] would do the same thing, as would print/unspaced ["a" "b" _ "c"] ; though the refinement could be called print/only ["a" "b" _ "c"], with whatever consequences that brings to understanding.
 
 
9 hours later…
2:54 PM
>> b: [x y z]
== [x y z]

>> t: <tag>
== <tag>

>> collect @[keep b keep t]
== [[x y z] <tag>]

>> collect [keep b keep t]
** Script Error: Must use /ONLY if not splicing BLOCK! into ANY-ARRAY!
** Where: _ do _ keep _ reeval either collect console
** Near: []

>> collect [keep b keep @t]
== [x y z <tag>]
@rgchris ^-- this is what I'm talking about, and I think that on balance, it works better than having a hidden poor invariant, which hurts newbies and experts alike.
If you prefer, make that collect @[...] a collect/only [...], because the modal parameter is just a shorthand controlling /only... same for keep @t being keep/only t.
 
 
6 hours later…
8:59 PM
@HostileFork I like it! :-)
 
9:33 PM
@giuliolunati I hope it works out, but one does not know until one tries! I will give it a shot. Interestingly it means BLANK will have to be a function...but NULL no longer will have to be, because null: _ would work, due to how null would evaluate! While it's a bit confusing, it is explainable, and looks to have some really nice properties...
rebol2>> select [[a b] 10 a b 20] [a b]
== 20
So going with what I'm looking at, you could alternately say select [[a b] 10 a b 20] @[a b]. And if you tried to select anything that isn't a block out of a block then you have to say e.g. select block @item or select/only block @item, to help understand the invariant. But how should this be handled with maps? I think that to make code generalize better with a map, you should always have to use /only with a map...as a kind of parallel to how you never use it with a string.
 
10:17 PM
posted on August 25, 2019 by hostilefork

For aggregate values, there has always been an ambiguous situation in Rebol as to whether an operation (e.g. APPEND, INSERT, CHANGE) means to treat another aggregate value as a collection of things to splice or a single item: ; Option (1) >> append [a b c] [d e] == [a b c d e] ; Option (2) >> append [a b c] [d e] == [a b c [d e]] From a technical point of view, the more fundam

 

« first day (3220 days earlier)      last day (560 days later) »