« first day (2271 days earlier)      last day (1509 days later) » 

12:17 PM
print "Hello World!" #rebol
 
 
1 hour later…
1:32 PM
Feeds from github are off? :-/ However, @HostileFork, there is an issue concerning switch fall through
 
 
2 hours later…
3:20 PM
@giuliolunati Great you're testing these...if you want to expand switch.test.reb that would be even better :-)
 
3:33 PM
@giuliolunati For instance, in that case, I'm not sure what you wanted...I guess it should fall through with 1, even though it matched. It doesn't seem a match should penalize it, since switch 1 [2] should give 2, then switch 1 [1] should give 1. (?)
Then what about switch/default 1 [1] 2 ? Currently that is 2, because no block was run. A "match" is only considered if a case is seen with an associated branch.
If switch 1 [1] behaved like switch 1 [1 []] (returning void), then I'd say switch/default 1 [1] 2 should be void. My guess is it's better to think of it as not a match. But that's just guessing. My argument would be that when you are throwing a value at the end with no blocks after it, you do not want the return result to be influenced by what the first argument to switch is by that point.
 
 
2 hours later…
5:18 PM
posted on January 18, 2017 by macco

[Hacker News] Red is full-stack programming language (2 points)

 
 
1 hour later…
6:36 PM
Though I initially thought they could offer benefit, I grew to dislike operations that are "opportunistic" about completing left-hand-sides of expressions "because they can". :-( I think it is now my feeling that operations like 1 + 2 <| 3 + 4 should specifically force completion on the left by a full expression. That is to say, it must be able to flush the left edge all the way to an expression barrier, beginning of block/group, etc. If it cannot it's an error.
 
 
2 hours later…
8:48 PM
Anyone have any ideas on how I would get Amazon Echo to execute some rebol code on a pc on my network?
 
9:45 PM
@MarkI I think the answer is simply that quoting infix operators are greedy (tight), non-quoted ones will accept left hand sides only when it would be suitable to place an expression barrier in the position of the operator. This removes the need for <tight> as a concept, though not necessarily for TIGHTEN the function adjuster.
So what +: enfix tighten :add would do is simply wrap up ADD with a new signature that quotes the first argument, then before calling add's implementation it reduces the quoted argument.
So then that is what tightness is. Quoting, plus reducing what you quoted.
Since the non-tight version can only be where expression barriers would be, that makes them unsuitable for expressions inside argument evaluations. Thus, tightened operators would be the norm for +, -, *, etc... preserving historical behavior.
And everyone winds up happy, except people who hoped to be able to pass :+ to functions taking binary operators as a synonym for :add, which is probably for the best since + becomes much more interesting with a weird signature allowing it to act as a variadic with (+ 1 2 3) when it doesn't see anything to its left.
>> summer: func [x [integer! <...>]] [
    sum: 0
    while [not tail? x] [sum: sum + take x]
    sum
]

>> sum: summer 1 2 3 |> 100 print ["sum was" sum]
sum was 6
== 100
^-- that is what I would refer to as "cool". Recognizes the non-tight left hand side of the |> operator as a barrier to arguments, so the varargs ends. sum gets complete expression. Right hand side is variadically evaluated, first to 100, then the print. The 100 is returned as the result because it's what the operator points at.
Put another way: if you're enfixed and you quote your left hand argument, you have to be greedy, and if you don't, you can't be. This actually makes a lot of sense.
 
10:37 PM
(I take it back. The people who will not be happy will be the people who want 1 + 2 * 3 to be 9. While I want that to be the same as add 1 multiply 2 3 and feel it appropriate within the mechanics of the language to be so, and doing otherwise requires "tightness" on the right hand side, which cannot be done with quoting.)
To put this another way, +: enfix tighten/r3-alpha :add would be the variant people would use to put the extra legacy tweak on it, while +: enfix tighten :add would give the version I believe is "correct"...in the sense of correctness mapping to the cleanest and most uniform evaluation model, which can generalize nicely to arity-N enfixed functions.
 
@giuliolunati Small glitch. Fixed.
 
@rgchris ^-- see above, long story short, the reason add 1 2 * 3 would be 7 instead of 9 is because * quotes its first argument.
Good parts: the only parameter conventions needed are the existing ones for quotedness or not, handling of arguments to the right same for N-arity functions whether they are enfixed or not. "Bad" part: no suppression of lookahead while evaluating right hand side arguments without quoting, making legacy operator "left to right" behavior impossible without a hack.
Consequence: enfixed operators which do not quote their left argument will often need a group around the entire operation. e.g. if (x: 1 + 2 <| foo x print "Hello") [...]. Enfixed operators which do quote their left argument will often need a group around that left argument.
 
11:38 PM
@HostileFork This will remove reduction from the user's expressive space. Think: permanently inefficient evaluation order.
 
@MarkI I've asked before not to use the term "reduction" in this way. As for efficiency, there is nothing less efficient about it.
A key argument of Rebol's evaluator homogeneity, vs. say providing "normal" precedence behavior, is that the homogeneity gives it strength in composition.
Infix represents a challenge on a few levels in the implementation, some (e.g. Boron) even thought it an unnecessary complexity. What I've wanted to look at is how this feature can generalize in a nice way, so it isn't "tacked on", so that it doesn't throw a big wrench into the model.
I think that once we start talking about these extra parameter modes, or another type of FUNCTION!, if you can avoid that and keep it down to more or less what you already had...that's good.
This quirk which is related to lookahead/lookback (not reduction) is a very specific and unusual quirk, about running operations that do not look back in a normal way, but if you see another operation that does look back you don't run it until after you're finished running the operation that was triggered via looking back.
It takes something that I think is adequately performed at a generic level by a pair of characters...namely ( and )...and ties it somewhat haphazardly to what kind of function is running and what kind of function is coming up next.
The stack may get deeper, but I just don't see stack overflows during chains of arithmetic operators to be a pressing concern; the majority of the stack is not operators.
 

« first day (2271 days earlier)      last day (1509 days later) »