« first day (2185 days earlier)      last day (1595 days later) » 

1:39 AM
>> type? attempt [print "Hi"]
 
; Brought to you by: try.rebol.nl
Hi
== unset!
 
It seems attempt would be more casually useful if it were more like ALL, or its result only came back false if there was an error...so basically suppress the non-error return result to avoid conflating falseness with failing.
So perhaps even attempt [false] => true, while attempt [fail "reason"] => blank!
 
 
10 hours later…
12:06 PM
@HostileFork @HostileFork There are some difficulties with that:
>> #[error! ["abc" 300]]
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/user-message.html
    *** ERROR
** user error: none
 
>> attempt [#[error! ["abc" 300]]]
 
; Brought to you by: try.rebol.nl
== none
 
If ATTEMPT fails, it is an error, and an error is thrown.
If ATTEMPT succeeds, the value it created is returned, except if it is an error, apparently.
 
@MarkI That isn't how Ren-C works. Errors that aren't raised (through FAIL, or internally with fail()) are ordinary values, and returned.
@ShixinZeng If you haven't yet turned off this horrible visual studio feature, please do. It messes things up on cut-paste by not doing it verbatim. :-/ Didn't realize it was doing that, what a stupid default.
@MarkI The more I think about the switching between enfixed and not functions, and wanting a "uniform function interface", I feel like there should be only one function argument gathering protocol...which forces a complete evaluation on the left of enfixed functions and ordinary arguments on the right.
I say that because that's the form I know is necessary for interesting operators, and I can't really think of any compelling reason for the variance (besides the ability to achieve backwards compatibility)
 
12:35 PM
@HostileFork can I define new local names in adapt prelude?
 
12:49 PM
posted on October 24, 2016 by hostilefork

In the once-hotly-debated question of whether it made more sense for UNTIL to be arity-2 (to match WHILE) and then have arity-1 forms of both WHILE and UNTIL as "LOOP-UNTIL" and "LOOP-WHILE", it was decided to keep UNTIL as arity-1 and put the burden of reconfiguring on the user (and then to make sure that burden was very small). To make that burden as small as possible, this goes ahead a

 
@HostileFork Got it.
The flexibility argument I made is not compelling.
The expressiveness argument I made is not compelling.
Anything that goes against the HF "shifting good, reduction bad" theory of evaluation is not compelling.
Sorry I bothered.
 
1:14 PM
@MarkI You still aren't speaking in the language of the actual implementation, which is lookahead deferment or not. And you are not giving credit to the value of uniformity. It should appear to be at least somewhat problematic to you when you pass something like :+ as an argument to a function to have the behavior differ from :add, and all the options we've discussed push a cost on that somewhere.
You'll pay that cost in one place or another. It could be paid by having a separate function type with distinct behaviors (OP! vs FUNCTION!). Or it could be paid by the recipient of the function having to guesstimate if the arguments would need parenthesization in order to get the lookahead behavior they desire, e.g. passed-in-function (1 + 2) (3 + 4) instead of passed-in-function 1 + 2 3 + 4, because it might behave differently even if arity 2.
I'm saying that in the big picture of things, the value of having one FUNCTION! type likely outweighs these combinatorics.
I'm basically asking do we really want there to be more things different about + and add than just "+ gets its first parameter from the left hand side", and that there is a desirability to having that be the only difference.
Because if that isn't the only difference about the function itself, then the other differences manifest in places where you're trying to treat a function as a black box.
And sure, we could pass the buck on that and say "caveat emptor", and it's definitely possible to say that's the price you pay for "expressiveness".
 
@HostileFork Just turned off the "auto formating" feature in VS, thanks for the tip.
 
Good, good.
@MarkI But the other option is likely to say that once in "canon" prefix form (or just unattached to a word, as a pure FUNCTION! value), a function ignores all its deferment argument markers. That feels really clunky to me.
In any case, I think the default for the left hand side should be to complete the left-hand expression...and you need to annotate to ask it not to. So this changes the sense of <defer>, arguably a bit more sensibly. It becomes more like "<bind-as-tight-as-you-can>"
It's almost <greedy>, in the sense of "snap up the first candidate value". <incomplete>? <eager>?
@ShixinZeng Naming... if you are going to have something like add 1 2 foo 3 + 4 such that foo is infix and takes 2 arguments... imagine the default enfixing would give (add 1 2) foo (3 + 4). So complete expressions. But you could mark both parameters to be <something> such that you get (add 1 (2 foo 3)) + 4. That something is a kind of "greediness", you might say.
But imagine greedy is not the default, you need an annotation.
This was being called <defer>, but that's a confusing name, and its sense was actually kind of backwards for the left hand side. So that needs to be flipped on the left, and it needs a new name, I'll start the bidding at <greedy>
And our controversy is: should functions only be able to honor greediness if they are in an enfixed state, for the sake of having a solid baseline calling convention in the standard prefix state.
 
1:39 PM
@HostileFork but deep in the Do_Core, it's greedy by default, and that's why you need <defer>, right?
 
@ShixinZeng The left and right hand side of infixed operations, historically, were greedy in R3-Alpha. There was no implementation infrastructure for anything other than greediness on the left, while non-greedy was the default for ordinary function arguments. We now have infrastructure for non-greedy on the left, and to set this up however we wanted.
Currently <defer> means non-greedy when used on the left of an enfixed op, and greedy when used on the right hand side.
I'm proposing that in an ideal world where we had only one kind of calling convention for enfixed operators, they'd not be greedy on any argument--including the left--matching their non-enfixed counterparts.
But for now, and for any future in which R3/Rebol2/Red compatibility is needed, greedy is needed. So it needs a name.
 
+: enfix func [arg1 [any-value!] arg2 [<defer> any-value!]] [
    add :arg1 :arg2
]
 
Yup. That would change to:
+: enfix func [arg1 [<greedy> any-value!] arg2 [<greedy> any-value!]] [
    add :arg1 :arg2
]
If the historical behavior was wanted.
 
Let me see
So with the change, "1 + 2 * 3" will be evaluated as "1 + (2 * 3)", because the second param is greedy for "+"?
 
Not proposing any change to the behavior with the updated annotations (e.g. a + with both args greedy is basically the + you know from R3-Alpha)
 
1:50 PM
OK. I am just trying to grok <defer> or <greedy>
 
I think <greedy> is already easier to grok than <defer> was, just wondering if there's a better name for it.
So one issue is how to name that, given that it will have to exist for compatibility. (So @MarkI will have it in the system regardless.) But the other issue is whether in the long-term holistic health of the system--when defining the operators for use in new code--if greediness is a good idea considering what it does to uniformity when modeling functions as "black boxes"
 
I don't understand why when "<defer>" applied on the right, it means greedy, mind explaining it?
 
@ShixinZeng "defer" was referring to lookahead. e.g. <no-lookahead>
Don't look to see if there's a lookback word; "defer" the lookahead to the higher level of evaluation, and let it lookahead.
(It was panned as the name a while ago, I just hadn't changed it because this feature is still in flux and getting hammered on, so waiting for things to settle.)
 
OK, then how/why they act differently on different sides of an infix?
 
Why did <defer> act differently? Because there was only one annotation, and that's what it meant. It meant in that case "defer looking ahead for the enfixed operator that's running". So it's like the left hand argument deferred looking for the op as long as possible.
Comprehending <greedy> would be more consistent as it speaks about the effects and not the mechanic.
Again, all infixed operators in R3-Alpha were what this would consider "<greedy> left arg and <greedy> right arg". And if you have multiple greedy operators in a row, the left one's greediness wins over the right one's.
 
2:00 PM
You said earlier that "<defer> means non-greedy when used on the left of an enfixed op, and greedy when used on the right hand side". I am trying to understand the difference between being on the left and right.
 
It was just written that way to interpret the meaning that way. The code paths are not common.
I didn't want to make up another annotation, so I came up with a likely-stretch of rationale for why it would mean that.
My stretched rationale was "hm, it's like the left hand side is deferring the discovery of the operator--specifically the operator whose left-hand side is being described, and running at this moment"
But of course, the operator has already been discovered and seen... it just "defers" running as long as it can, continuing to reconsider what the evaluated left hand side is as long as there's a partially completed expression that can be pushed further to completion.
I wouldn't be proposing the shift of the sense to <greedy> (which has a visibly similar effect whether on the left or right) if I didn't think it was clearer. :-)
And we get rid of <defer> entirely.
 
Could you can explain to me what role "<greedy>" plays in "+" when evaluating "1 + 2 * 3"?
 
It has no role with the 1 on the left in that case, because there's nothing besides the 1 there to consider. It is what makes it grab the 2 as the second argument, and not let 2 * 3 run.
 
If it's greedy, shouldn't it grab "2 * 3" (as far as it can go)?
 
"greedy" in this case means "get a value for the argument as fast as you can", not "as far as you can go"
<myopic>
 
2:12 PM
hmmm, in that case, I'd say it's confusing
 
Well I've wanted to kill the feature entirely, and I have some reasons why I think the evaluator should be uniform and functions should get their arguments in a uniform way.
But we need it for compatibility, so it needs a name.
 
I see
 
<tight>, <aggressive>...
 
<left-to-right>
 
<sticky>
<priority>, <precedence> ("has precedence"), <primary>
<minimal>
 
2:20 PM
Actually, "<minimal>" was something that just came to my mind too
 
A lot of these terms seem to have trouble with labeling because it depends on whose perspective you are seeing it from. e.g. lookahead/lookback, and here the question of whether it's being "greedy" or "lazy" or "demure/deferred" or "aggressive" requires you to finish the sentence. greedy about what, lazy about what, aggressive about what...
The size of the expression? The speed at which you're acquiring the value?
<shortest>
<least>
 
<least> needs least keystrokes :)
 
It's a bit less likely to make people think it's going to do math on integers or something, the way <minimal> might.
 
right
 
<brief>
I still like <greedy> though; I realize it can be confusing ("greedy in what sense?") but to me it helps to suggest something about the evaluator's behavior with that parameter; it is clearly a property of the argument processing, and not something about the value itself.
<priority> is also not too bad in that it says "this has precedence", and it relates (somewhat) to as much precedence as the evaluator is going to have.
<impatient> :-)
<tight> is an interesting one also, just for sort of addressing the spatial effect.
 
2:38 PM
I don't like <greedy>, as it's confusing to me. :)
 
@ShixinZeng <tight> has an advantage over <least>, <minimal>, <shortest> as it feels more like it's describing a spatial property of the code and not a mathematical processing of a parameter.
 
Yep, it seems to be a good candidate as the way you put it
 
Well it doesn't have to be final, but it's better than <defer>. Let's go with it for now, see what @Brett thinks, and get the sense for the left hand side switched.
So now when you enfix an operator by default, it will not be tight on the left. It will complete the left hand side.
 
Understood
 
Step by step, becoming more comprehensible. But yeah, I think that my leanings may be to say that in my canon distribution there is no <tight> on +, -, =, or any of that. There's one fingerprint for FUNCTION! with the only variance being if it gets its first argument from the left or not when assigned to certain words.
@MarkI So relax, because if you look at just how much effort has gone into letting everyone have what they want, it's not much for me to be designing the thing that makes sense to me as part of that.
And sometimes, by trying to live in the hypothetical model, I figure out reasons it won't work. Then sometimes that means going backwards, but usually it means a third option that had not yet been considered.
And speaking of which, the uniform model for enfixed operators really does bring that whole "not" precedence thing up, where you can't just invert an expression containing infix at the operator level by throwing a "not" at the head of it. But as I've said, this is something people from other languages are totally used to, you can't say (! x == y) in C or JavaScript or wherever and have it mean !(x == y).
And with UNLESS and UNTIL (being properly the arity-2 invert of WHILE) then hopefully IF NOT and WHILE [NOT just won't come up often enough to worry about the parenthesization.
 
3:32 PM
@MarkI Case in point (of finding counterexamples...) ELSE. The interesting trick of ELSE-ness relies on if condition [stuff] else [stuff] being able to tie together those blocks to make a brancher. But if condition [stuff] is a complete expression. So it wouldn't work without <tight>.
 
4:00 PM
Are you sure? It certainly won't work unless the ELSE quotes its left argument, and, given that, (if cond [stuff]) else [stuff] works just fine.
 
@HostileFork please, I need your help for adapt. I wish to use new local vars in prelude, but I doubt it's possible...
 
@giuliolunati Nope, that's not supported yet (you aren't even supposed to be able to access the existing local variables, though nothing is prohibiting it at this time I don't think). You might have to just write an ordinary proxy function for now. :-/
I'd like to be able to do things like add refinements to functions, and so that feature would come along with that change.
@MarkI Firstly I wouldn't want to write (if cond [stuff]) else [stuff]...and secondly, that's not how it works. It's if cond ([stuff] else [stuff]) in order to build the abstraction that can be given as a parameter to IF, as IF is what has the knowledge of condition.
And in other "hmmm" news, I think that x: 1 + 2 |> 3 + 4 has to act as x: (1 + 2 |> 3 + 4) and set x to 7 and evaluate to 7, as opposed to (x: 1 + 2) |> 3 + 4 which evaluated to 7 and set x to 3. I was thinking the latter because I was in a bit of the mindset that |> was "expression-barrier-like"
But nearly all enfixed operators are operators, that calculate something you might want to assign. Including that one.
This suggests that "deferment" (non-tightness) isn't much related to user-mode expression barriers (it already wasn't, since it doesn't terminate expressions...it just processes as much of an incomplete expression as it can)
@giuliolunati In summary: that feature is desired but not scheduled yet, and there are things that are higher priority. So if you can write an ordinary wrapper and make a note that it would be better done with a nice function generator, that's probably best.
 
4:32 PM
FYI @HostileFork, we already have "tightness on the right":
>> myadd: func [l :r][add l r] print ["Loose:" add 1 2 * 4 newline "Tight:" myadd 1 2 * 4]
 
; Brought to you by: try.rebol.nl
Loose: 9
Tight: 12
 
@MarkI As long as it's not a function call. "tight" includes how things react to some-func arg as well as just to arg.
But that is a distinction between the left and the right sense of tight. :-/
But a distinction that comes from a mechanical reason. You can't "jump past" the some-func on the right hand side to get to arg.
(nor omit arg and still somehow meaningfully interpret some-func)
 
@HostileFork You mean, you want it to behave differently on functions, to evaluate the function call and then stop. So why do you not want that on the left? 2 * add 3 4 loose-tight-infix-func right-argument could pass the result of the add 3 4 to the func ...
It just goes on like that, and that is a big reason why this should be in user space, not in the language.
 
There's no real distinguishing point for why to stop at any potentially complete expression vs. another.
 
Yet that is exactly what you are trying to define!
 
4:43 PM
You either flush as much expression on the left or as little.
Those are the obvious extremes, in between is less obvious.
 
@HostileFork Belied by you wanting tight-func add 1 2 to receive 3 ...
 
Defining things is good.
Occam's razor, it has no other choice.
As tight as possible, but no tighter.
I suppose it could error.
 
So you'd disallow quoted arguments from getting the add word in that case too?
 
Quoting is a tangential and different feature, and I don't see what bearing it has on this, other than you thought it would be a way to simulate tightness. While there's a very superficial truth to the idea you can simulate small evaluator features with quoting (and now even non-superficial with variadic quoting) we are talking about something else.
 
>> myadd: func [l 'r][l + r] print ["HF-tight:" myadd 1 (multiply 2 4) + 3]
 
4:49 PM
; Brought to you by: try.rebol.nl
HF-tight: 12
 
Well, you aren't going to like that one either then. :)
 
Look, I said we'd be better off without this thing in the first place! I'm just trying to reason through it and minimize whatever damage it does.
 
Sorry? Better off without what?
 
<tight>
But I'm now having to ripple through the ramifications of non-tight default on the left (what used to be <defer> left) and it has some downsides compared to the established "greedy" or "non-defer" behavior.
 
Better off without backwards-compatibility then?
 
4:52 PM
I said we'd need it for that, but not for new code in new projects.
 
This is bordering on a religious war, when to force the user to use parentheses, and when to allow them to be omitted ...
 
Well, one thing that helps religious wars not be religious is to incorporate reason and be aware of the tradeoffs. I'm plenty aware of lots of them, make lists, live in the ramifications of various decisions and think about them.
 
I am sorry to say I side with Rebol, that simpler is better. In this case, simpler to read as well as simpler to express the rules of the behaviour.
 
So the issue in a language seeking to reign in complexity is when is the amount of complexity introduced by a feature not worth the "expressiveness"
 
Right, you are going to call Rebol's existing rules "complex" and your new ones "simple".
 
4:55 PM
There is no effing way that the lookahead adjusting rules are "simpler"...and every false, oversimplified, ridiculous argument that comes straight out of "I'm used to it so it's simpler" is exactly that.
If you want to talk about simpler, the simpler is apparent when it's fewer lines of code, fewer exceptions to the rule. That's what simpler is.
 
You are using implementation difficulty to judge usefulness.
 
If you want to say something is "more expressive" and "more nuanced" then you are not making an argument about "simpler"
So "simpler to express the rules of the behavior" is right out for the old rules of lookahead.
 
The rule is "operators reduce". Period.
 
No, you use entirely the wrong language, from entirely the wrong model of computer science, to describe something that's not that at all.
It's not that, period.
It's one unit of lookahead, and during the evaluation of arguments the evaluator can be passed a flag as to whether to suppress that lookahead, and this suppression is historically done on the right hand side of infix operators for the level of evaluation of that argument at that immediate level only.
 
Inside it's difficult, I agree, but you are blinded by the trees sorry @HostileFork, to the outside world "operators reduce" is sufficient.
 
4:59 PM
That is the only way it can or should be talked about because everything else you might as well be calling it RVC or something.
 
I deny resembling that remark!
I am using well-known computer science terms to describe a computational thing.
 
@MarkI Okay. Let's get some respected computer scientists in here who don't know Rebol. We'll tell them "operators reduce". Then we'll ask them to predict the outcome of a series of arbitrary Rebol expressions which are a free mixture of prefix, infix, and parentheses.
 
I'm up for that, that's a good challenge.
 
Bigger challenge: finding respected computer scientists who would come anywhere near us. :-P
 
:)
I even know a guy hereabouts who wrote a book on Smalltalk ... will he do?
 
5:03 PM
Well, anyway, there's no complete story here yet even for what's being talked about today. I even had a change in how the variadic enfixed |> works with respect to assignments. So there's still a lot to look at.
 
And we do have to assume there's a way to differentiate operators from normal functions just by looking at their word-name.
 
@HostileFork thank you, it's good enough for me.
 
@HostileFork As long as minds are open, I am OK with discussing anything.
 
@MarkI We aren't able to differentiate arities just by looking at the word name. Why would this be different?
 
@HostileFork For a non-Rebol person?
 
5:05 PM
I believe it's useful to have operators which do more than grab the thing right immediate to the left of them, so print "Hi" some-infix-thing print "There" being able to have some-infix-thing get something other than "Hi" out of the bargain.
 
@HostileFork I look forward to this belief being borne out through practice.
 
@MarkI Sure, for anyone. Why in a language that is all about context, dialecting, etc. and freedom from keywords enforce a rule on the naming of an infix operator? Consider also x: default 10
It's nice to see the thing that may-or-may-not be assigned on the left.
Once you say my-dialect [blah blah blah] all bets are off, isn't the goal of the language to have that "open mind"?
To challenge and question people from more rigid languages about what they might have lost in that process?
 
It can't be everything to everybody.
The open-mindedness comes from what you are willing to forego, not what you want to be in.
And yes, I may one day be willing to forego infix reduction. But I will need to see a lot more out of its replacement.
In contexts not created by other changes to Rebol's internals!
 
Well, it's a valid challenge to ask why add 1 2 some-tight-infix-arity-2-thing add 3 4 isn't more symmetrical, given add 1 (2 some-tight-infix-arity-2-thing (add 3 4)) doesn't look like (add 1 2) some-tight-infix-arity-2-thing (add 3 4) or add 1 (2 some-tight-infix-arity 2 thing add) 3 4). It's good to bring such challenges.
But the answer to some of these things is that the evaluator goes left to right. It has different abilities and prescience (or lack thereof) when coming from the left than it has from the right. So it has an asymmetry from the get-go.
Right now I'm kind of grumbling about the fact that I depend on <tight> semantics for the ELSE trick's left argument. It is, however, a trick...and one people were living without. It's not worth breaking a more coherent holistic model just for that.
 
@HostileFork For our challenge, if we provide a table showing each word used in the example expressions with its arity and operator-ness, I'd be OK.
 
5:18 PM
@MarkI If you get interested in making such a table, include some SET-WORD!s at various positions, and be sure to include cases like 10 = probe 5 + 5 and 10 = 5 + 5, mention that erroring is one of the potential outcomes.
If you make a sincere effort at such a table, I will go over it, and make sure it is sufficiently mean. :-)
 
I will only be able to say word: expr is exactly like (set word expr), including the parentheses.
Because understanding set-words is impossible for a non-Rebol person.
It's hard for experienced Rebolers!
 
Well, then, wouldn't it be nice if someone figured out how to make it not-hard...
I wonder who might have done that? :-)
 
Er ... I just did ... :)
 
@MarkI You depend on a knowledge of what forms an expr.
Anyway, what's frustrating here for me right now is--more than anything--the question of how much one can get out of the left hand side of an enfixed operator.
 
@HostileFork Right, the challenge is to test how much info besides "operators reduce" experts need to figure out what an expr is.
 
5:28 PM
Quoting has been experimented with and is at the moment reasonably well understood, in the sense that inert things can be quoted on the left, like SET-WORD!s or inert values, but those understandings came from a longstanding assumption of "<tight>" semantics on the left hand side of enfixed operators.
You don't have to worry about being unable to quote the left arg of add 1 2 infix-quoter 3, because infix-quoter runs before the add, as add 1 (2 infix-quoter 3), so there you go.
My belief that it was useful to have a "flushing" enfixed operator that tried to complete the left hand side "as much as possible" was used to make interesting-seeming operators like |> and <|, and in a sense it feels "more like" a slight rearrangment.
multiply add 1 2 add 3 4 => add 1 2 * add 3 4, just the movement of a complete expression from one first argument slot to another.
This process would continue... 1 + 2 * 3 + 4... each time, the operator being happy to defer the left hand argument to any complete expression. So (1 + 2) * (3 + 4). If you transform any prefix expression to move its complete first argument into the left slot of an enfixed operator, the meaning is preserved.
SET-WORD! throws a wrench in it, because multiply x: add 1 2 y: add 3 4 is expected to be different from x: add 1 2 * y: add 3 4.
But from a uniformity point of view, I'm not so sure it should be different.
But there's "should" and then there's expectations. People think x: 1 + 2 should leave x as 3, not act as add x: 1 2.
So this starts to make SET-WORD!s seem a little ghostly. They're not really part of the expression, so much as sampling the value at some point of evaluation.
Anyway, I think it seems pretty reasonable to complete expressions on the left hand side of enfixed operators as best you can. This is also a bit more like traditional languages which put infix at a lower precedence level than other things.
It's nice to be able to say if some-func arg1 arg2 = other-func arg1 [...] or whatever and not have it start from the assumption that you meant if some-func arg1 (arg2 = other-func) arg1 [...]
 
6:23 PM
With the flexibility given by adapt, enfix and user natives I think possible to implement decently matrix calculus totally at user level.
 
@giuliolunati One area that I think really needs a solid story is exactly what the deal is with "overloading". Rebol has the unique case of binding, where a word is not taken for any particular purpose...so you build contexts and dialects where the same word can be interpreted or dispatched different ways. But then it still has times where it wants a common word or symbol to be able to have a single binding yet dispatch to different code depending on the type it is passed.
Right now, this means if you have a function that you think is generic, it has to be an "action". Let's assume you can make an action as an end user (you can effectively make one today, where you register different types in a map or table, and then dispatch yourself...but there is no standard protocol).
But when do you make something an action? Or rather, when wouldn't you make something an action? What kinds of operations are so finalized that you don't want them to be able to dispatch to other types?
I faced this trying to make infix mathematical and* actually just a synonym for the prefix set operation intersect. This would mean making intersect work on numbers, and intersect the bits. But INTERSECT was a native, AND was an action. How does this kind of decision get made, what's the longer story?
As usual, I'll say that looking at the difference between the functional programming paradigm (pattern match, ambiguity checks) vs. trying to wedge new ideas into an imperative free-wheeling platform, the question is "how broken are you willing to make it, and for what convenience benefit you get in return?"
And in particular: "given that you believe failures will be rare given your domain (enough so to use a tool that favors expedience/brevity/convenience), how can you make the failure modes raise errors (vs. unpredictable or garbage)"
Multiple dispatch or multimethods is a feature of some programming languages in which a function or method can be dynamically dispatched based on the run-time (dynamic) type or, in the more general case some other attribute, of more than one of its arguments. This is a generalization of single-dispatch polymorphism where a function or method call is dynamically dispatched based on the actual derived type of the object on which the method has been called. Multiple dispatch routes the dynamic dispatch to the implementing function or method using the combined characteristics of one or more arguments...
@MarkI Hmmm. On second thought, there may be more to the link between tightness and quoting than I first observed.
If tightness is quoting, then that has an advantage in that it would catch cases that would be incompatible under the new "non-tight" default rules. Hm, though it would make :+ not a synonym for :add, once again, so there's that.
The interesting consequence would be that enfixed operators would follow the "natural" rules unless you wrote a weird one, and if you wrote a weird one the thing that makes it weird is it quotes its argument as you have done in your examples. They could successfully GET words, and as long as it's not a function they will work.
 
7:08 PM
@MarkI As an interesting note, under my new proposed baseline, pure infix is left to right for an entirely different reason. 1 + 2 * 3 has no <tightness> on its arguments, so it's willing to try and grab 2 * 3, but it doesn't because 3 has no <tightness> on its arguments, including the left hand side...so it allows the left hand side to complete, before running!
So when you take that, and factor in the idea of achieving tightness-when-you-need-it through quoting, you get something interesting that doesn't introduce any annotations you don't already know about.
For some percentage of compatibility, you then make your infix operators quote. If they can't work that way, they error, so you at least know.
@ShixinZeng See above unexpected observation about the potential manageability and compatibility in a world without <tight> --^
 
8:02 PM
@MarkI Note the unusual twist on what has been said before. add 1 2 * 3 and 1 + 2 * 3 are the same, and they're both 9. I think there's sort of a natural-language rhythm to this interpretation that's more consistent than the previous attempt to enforce consistency.
 
8:13 PM
@HostileFork I like this behaviour
 
@giuliolunati The nice thing is, that if enfixed operators look for "complete expressions" in their left hand argument, they become naturally similar to their non-enfixed forms. I mention the exception of add x: 1 y: 2 and x: 1 + y: 2, but SET-WORD! just cannot be considered part of the "complete expression" and have things act how people expect.
However, to achieve what we're talking about with true quoting of the left-hand side of enfixed things, the current ad-hoc pseudo-quoting has to go. It has to be able to hard quote the left hand side of an enfixed operator for real. That's two units of lookahead.
I am looking to see how this could be done.
 
 
1 hour later…
9:32 PM
So I think this is the long term answer...that there is no such thing as <tight>; and the few things that mirror <tight>-like abilities are tricks that lean on a better left-hand quoting mechanism. I'm going to punt on that improved mechanism for now because it's tricky, the common tricks (like ELSE) are already covered by the scrappy quoting mechanism of today, and because it wouldn't be able to achieve full R3-Alpha compatibility anyway.
 
10:17 PM
posted on October 24, 2016 by hostilefork

R3-Alpha achieved an apparent "left-to-right" via lookahead suppression. So when evaluating: 1 + 2 * 3 Lookahead would be enabled by default, 1 would evaluate to itself and see an OP! in that lookahead. During evaluation of the remaining [2 * 3], lookahead would be disabled. (This would happen during the right-hand side evaluation of any OP!.) Hence it would see the 2, which would e

 
 
2 hours later…
11:48 PM
Is the bot that links to new Rebol questions from StackOverflow working? I noticed a new Rebol question from Bo Thompson that didn't appear here.
 
@Respectech Hm. I don't see anything about those feeds in the feeds list: chat.stackoverflow.com/rooms/info/291/rebol-and-red?tab=feeds
 
@Respectech Pasting raw links (with no other text in the message) "oneboxes" them.
1
Q: Rebol2: Change-dir to absolute filepath not working

Bo ThompsonI'm trying to read a filepath from a config file and then read from that directory. I can't find a way to make it work though, because for some reason change-dir never goes to an absolute filepath. Here's a transcript of me trying to make it work on the CLI. >> test: pick read/lines %test.ini 1 ...

It should have fed the questions and the answers, perhaps @rgchris knows what's up with that and why they're not in the feeds list any more.
 
@HostileFork OK, thanks. I already answered that question, but was wondering why it hadn't shown up here to get my attention. :-)
 

« first day (2185 days earlier)      last day (1595 days later) »