-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LANG: 0 should not be a "branch inhibitor" #365
Comments
Thanks for your feedback Mr. Fork :). I think your proposal makes sense, and I was always cringing a little when I had to write "Truthy" in documentation or tutorial and thought that this might have to change at some point. The reason I initially didn't implement boolean true / false values is that I remember from rebol (at least I had some confusion) of what is Since I'm not sure if there is really something odd about true / false in Rebol I went trying now, correct me if I don't understand something ...
Ok, so maybe it does make sense, it looks to me from this that true is a word, like a constant, that is bound to logic value true. The confusion comes maybe that logic value has the same spelling in REPL as the word and that it's easy to mix them up? Your argument about branch inhibitor makes sense to me. I wasn't thinking about that but yes, it's certanly a source of bugs and limitations and inconsistent at the end. And I want the language to be flexible, but environment and values explicit so I want to go away from all truthines and falsines. Concretely, with this I would redo for example So true and false would still be functions, because I don't have builtin constants in Rye runtime for now. But they would return a "env.Boolean". In Rye console the returned value is printed with type information so it will be [Boolean: true] which would avoid the confusion in repl. I will read the other links you sent in next days. I see you mentioned goroutines ... if you haven't seen yet, here is some related information: https://ryelang.org/blog/posts/rye-concurrency-go/ About Note please that in Rye every token (also []{}(()) has to be space separated so |
It's not just you. It is indeed very inconsistent. Ren-C solves this problem (and others) in a fully generic way, using what are called isotopes. There are some states which variables can hold which are not able to be stored in blocks. This has been applied to solving many different problems: https://forum.rebol.info/t/a-justification-of-generalized-isotopes/1918 So, the "antiform" of the word "null" is the only thing that acts as a "branch inhibitor" in Ren-C. There is a complementary antiform called "okay" if you want a canon "branch trigger" that can't be stored in a block. But if you want to use words to represent logic...like TRUE and FALSE...you can do so. But IF and friends don't test those. So you would have to say if flag = 'true [...] or if flag = 'false [...]. And there are narrower functions TRUE? and FALSE? which ensure the thing you are passing is only in the set This has worked out very well. In places that are user-facing--where a variable's state might be readily exposed--using words makes sense. In other places, like the value of refinements that can only be on or off, easily testing them is more important so they use the
Making conditionals test against a null state (where that null state cannot be stored in a block) has resolved the historically annoying problems. You don't have random failures when writing:
I think it's an important invariant--that should succeed for any state of block1.
The specific strategy of isotopes (quasiforms/antiforms) is not something you'd have to copy completely. But you could just say some states can't be put in blocks--only held in variables. Though I think that would possibly lead you down the path of thinking that the right "API" for getting at what these forms are is to think of them as variants of plain values. In practice, I think a lot of things work out better when there is only one branch inhibitor...you can write things like all [x = 1 y = 2] and not worry about the failing state of that coming back as false vs. none/null, because there's only one such state. Array splicing is one of the many things that work out better if you have a splice type that itself cannot be stored in blocks.
|
Hello! Long time no C (mid day or other time 😃)
Was told about your progress on the GUI, via someone sending a hackernews link. You're famous! :-)
I was very pleased to see you had decided on
{...}
as a list type. I have come to believe this is very important!(Not sure what state of development you consider yourself to be in, but if you think things are still malleable, calling
{...}
a FENCE! and[...]
a BLOCK! seems really nice, and would help us standardize our terms...)I think there are promising aspects to using Go as a substrate, I definitely think green-threading and such is good, and would hope to learn from what you find.
But I did do some digging, to try and understand what you are doing:
https://forum.rebol.info/t/rye-language/1768/6
The first thing that jumped out at me, is something I would urge you to go back on:
Might I convince you to back that out, and, hopefully re-engage the Ren-C design... (which is getting very, very good!)
I'm hoping that Rebol-derivatives might standardize more things, even if they cater to variant audiences (Go programmers, Nim programmers, etc.)
The text was updated successfully, but these errors were encountered: