« first day (1073 days earlier)      last day (2707 days later) » 

12:01 AM
@earl I like that
but for scalar types to would do a direct conversion?
 
@Adrian TO-STRING you mean?
 
@earl yes
 
I'm not sure what a "direct conversion" is, then :)
 
I guess what is currently done - i.e. not deferring to another function.
 
Well, yes and no, then :)
What's currently done is already deferring to another function (FORM, that is).
 
12:07 AM
oh, didn't know
so to string! 1.0 calls form ?
 
Internally, yes. But with a flag ("/tight") that is not exposed to the user-level.
(Which does not make a difference, for scalars.)
 
So what would be the justification for to string! existing alongside form for string conversion of complex types (albeit with a baked-in set of parameters)?
 
Convenience and frequent use.
"Practicality."
(And wow, do I hate to be on the wishy-washy side ...)
 
I prefer form/tight as opposed to to string! for the [ 1 2] => "12" case as it feels more predicatable. Would there be any objections to exposing this refinement on a user level other than the duplication of functionality?
That also reminds me of the number of times I have wished that Ladislav's flatten function was included as default
 
12:51 AM
So wondering out loud here, but in matters like this, where the claim is about common usage vs user preference for invariants, is there any way to solicit opinions on this besides guessing?
 
Analysis of existing code and user polls, I guess.
Some known (to me, off the top of my head) open Rebol code bases: R2 mezzanines, (R2 SDK; not open), R3 mezzanines, Red, R3-GUI, Maxim's libraries (github.com/moliad), rebol.org Script Library.
 
1:53 AM
I currently have two open code bases: QM and Support Files (QM is in large part a collection of functions extending the core—each component is included by some necessity or other); Rebol 3 Scripts (there's a fair bit of crossover between the two). Also PowerMezz (Rebol 2) includes some worthy contributions—is as open as any other SourceForge project, I suppose...
 
Not to forget your Rebol 2 Scripts!
 
Not quite as open, but all available to peruse :)
 
Well, the "open" was only intended to describe accessibility, not license specifica. Bad usage, sorry.
There's also venerable old Vanilla (doh!).
 
Not so much license (which I should probably update to address common criticism), just that there is not an open repository for them.
 
Then, of course, our beloved RebolBot along with Graham's assorted collection of other stuff (mostly Rebol).
Besides Red, there's also Nenad's Cheyenne and CureCode. And the collection of libraries written during his SoftInnov time: softinnov.org (LDAP, Postgres, MySQL, etc.).
Somewhere, there also was a source drop of QTask available. Not sure if that ever was on the public web, though.
 
2:03 AM
Going back, there was Andrew Martin's Values project but seems to be incomplete here.
 
And there are Ladislav's assorted scripts (many of which are also on rebol.org, though, if I am not mistaken).
 
 
2 hours later…
 
5 hours later…
8:59 AM
@HostileFork Since I'm using a (almost) perfect editor (vim) which highlights well my code, I can see right away where strings are, and spot where I put variables, etc. I haven't gotten yet the reflex to use {} to embrace my strings: I'm still a bit python-thinking; it'll improve...
@rgchris Thanks!
Thanks for racing, @DocKimbel and @rgchris! ;-)
Now, what about implementing this new "method" AND a proper convention for a constructor in Rebol and Red?
I'm thinking about newcomers, especially people used to do OOP: if they don't have to make themselves this (very little) piece of code, Rebol may look more "mature" to them.
Bonjour, @DocKimbel!
thanks for constructoring!
I accepted both answers, but obviously, only one must remain in the end?
 
9:22 AM
@pierre Bonjour Pierre. This is IMO a bad fit for a prototype-based language, as I mentioned in my SO answer to your question, your "constructor" function will be duplicated in every object, so it's a waste of resources. Rebol is not meant for doing OOP in a class-like way.
 
@DocKimbel Yes, I agree!
But if someone really wants to implement a constructor method, there should be a "standard" way to do it.
 
I have been considering adding a new class! datatype a few times, but I'm fearing this will open a pandora box or requests from users to switch completly the language to a class-based model (forcing objects everywhere for everything).
 
A clear comment should be made on the HELP little page, to warn the programmer about possible wastes of resources, if these constructors would be used.
 
@pierre As it is not a standard feature of objects, there's no need to enforce a standard way to implement it. ;-)
@pierre It's explained in the object! description in the Core manual (Rebol users are supposed to have read the Core manual at least once).
 
@DocKimbel Hm, this would not be a good idea... Why would one feel forced to program in a class-based manner?
Oops. I read it, several times, but I must have missed this one...
I said *read* => not *fully understood*...
@DocKimbel It may not be standard, but it sure is handy!
 
9:34 AM
@pierre Because of lot of programmers out where only know about class-based programming.
 
I just came across this chapter:
5. Core 2.5.2
5.1 Fonction CONSTRUCT, pour créer un objet
 
@pierre Actually, I kind of remember that Carl proposed an init constructor support in objects (or modules?) in blog article, but can't find it anymore...
 
But obviously, this is not really related to what I was expecting...
 
@pierre I quickly re-read the object! chapter of the manual, it's not explicitly explained, only mentioning cloning or copying object.
Hmm, my typos rate is high, I need a coffee break. ;)
 
@DocKimbel Getting closer to apéro-break time, isn't it?
 
9:43 AM
@pierre I don't drink alcohol while coding. ;-)
 
 
2 hours later…
12:07 PM
@michaelb Welcome to the Rebol and Red room. See our FAQ. Sadly you won't be able to talk to us at present. You need a few more reputation points on Stackoverflow to join these chat rooms. If you answer some questions, or ask some, we might be able to help by upvoting you. In the meantime, have a look at a Rebol introduction.
 
@GrahamChiu I tried, but could not reproduce the errors we were seeing with the who-is-online command. I have re-enabled it here and it seems to be working as expected now. (I removed myself as a test)
Hi @michaelb welcome. If you can ask a rebol related question or two then we can help to upvote you. Simple questions are good :-)
@hostilefork don't worry about rebolbot going wild with this bug. The worst that happens is she will go to sleep for a while
 
12:33 PM
@johnk Worrying is my middle name. Hey @WayneTsui, what's up?
 
@HostileFork Just coming back from a 7-day vocation.
I must missed a lot of interesting chats!
 
@WayneTsui Ah, well you missed 7 days of some new features and fixes being pushed. Found the notorious TCP bug, which is good.
 
@HostileFork Great! Thanks a lot! :-D
 
@WayneTsui One of my must-have features is the ability to call functions to generate rules in PARSE, and I've got an implementation in for that.
Oct 4 at 16:38, by HostileFork
user image
@DocKimbel What do you think of the AND and OR type operations treating their arguments with the same permissiveness of IF, ANY, ALL? Not enforcing logic!, considering FALSE and NONE to be FALSE and everything else TRUE?
Red will have enforced typing via the compiler, so if you really want to ensure something is a logic! you will have other ways to do it.
 
@HostileFork Very cool! I plan to study parse these days.
 
12:46 PM
@WayneTsui Do you ever use Regular Expressions?
Parse is easy to get started with, although not as easy as it should be. That's one of the reasons we want these nice character generators with things like letter, digit, whitespace, digit/hex, letter/upper etc.
What is tricky is that now that Rebol supports unicode codepoints, the bitsets used to represent characters can get very large in theory.
4
A: Unicode code point limit

Holger JustUTF-8 underwent some changes during its life, and there are many specifications (most of which are outdated now) which standardized UTF-8. Most of the the changes were introduced to help compatibility with UTF-16 and to allow for the ever-growing amount of codepoints. To make the long storry sho...

 
@HostileFork I don't see what advantages it does bring.
 
@DocKimbel Well, I'm not so sure now that unused refinements should be false in functions. And I'm not sure used ones should be true, either. It's not looking like such a good idea to me anymore.
One of the main reasons I liked being able to count on it being a logic! was so that I could use them in AND, OR, etc. in the function body.
 
@HostileFork What do you think refinements value should be then on set/unset?
@HostileFork My choice was based on optimizing refinements unset value for PICK block! logic! pattern. I often need to add an extra TO-LOGIC for PICK and sometimes for other code patterns too, so it looks useful to me to replace the TRUE/NONE by TRUE/FALSE.
 
@DocKimbel I think none! on unset, and one idea I had for it would be to be initialized to the value of the refinement or word itself... whatever you know the symbol is already allocated, and it's "not random" in the same sense that if you ask someone to pick any positive integer, a "logical" choice emergent from the problem statement is 1.
@DocKimbel There seems to be a fair amount of support for letting EITHER/IF/UNLESS work with non-blocks... if that is true, then this wouldn't be needed for that purpose.
 
@HostileFork initialized to the value of the refinement or word itself That's redundant information.
 
12:57 PM
@DocKimbel By being redundant it's not new information, which is good if the new information does not contain value. It was an idea, and it could be helpful at least in debugging or tracing back to where a value came from... perhaps chaining somehow if you were generating an apply call and reusing the refinement if it was set.
 
@HostileFork I wouldn't clutter the language semantics for the sake of debugging convenience, when debugging can be achieved more efficiently using different approaches (like having an IDE).
 
I'm not terribly concerned about it, though. It's just a way of thinking about the problem when you think of the space of all things it could be set to. True is okay I guess, it's func's business. The main thing is that if refinements are used for locals declaration, then the TRUE/FALSE initializations are kind of random seeming. None seems like a much better default initialization for things not used in the function invocation.
 
Having a refinement, which is a function option set to TRUE/NONE or TRUE/FALSE looks fine and logical to me.
 
@HostileFork Very nice enhancement to parse - I hope you get some positive feedback for your pull request
 
@HostileFork I see TRUE/FALSE more useful for users than TRUE/NONE currently. We'll see in the future if this is still true if a new ternary operator gets used more often than PICK.
@HostileFork If I'm not mistaken, you can already achieve the same thing using LETTER: CONTEXT [...] instead of a CLOSURE, and it will already work in Rebol3.
 
1:08 PM
@DocKimbel You're likely mistaken. And thanks, @johnk.
@DocKimbel Something generally concerning me is that you (and some others) don't think there's anything wrong with pick [a b c] true being a and pick [a b c] false being b. You actually don't look at that and have thoughts in your head like "hmm, wow, when I think of numbers and booleans... false is less than true... yet here it's picking something higher in the block" or "gee, how could a boolean ever pick C or anything after... booleans seem like bad pick arguments".
The fact that people see the world through Rebol-colored glasses that have no reality to them other than "about 50 programmers in the world did it this way for a while" is a pattern that if not fixed, will continue to limit growth and appeal.
Because some of the strongest arguments for Rebol are kind of beauty and aesthetics related. And when you throw that out on a daily basis, the whole thing falls apart.
It's like Humpty Dumpty. "A word means whatever I want it to mean." => "Because we can sniff the type of a boolean directly by PICK instead of converting it to a number first and then picking, we are able to have it mean whatever we choose. So we chose something nuts. And we're standing by it."
 
@RebolBot
letter: context [lower: make bitset! [#"a" - #"z"]]
probe parse/case "hello" [some letter/lower]
probe parse/case "Hello" [some letter/lower]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> letter: context [lower: make bitset! [#"a" - #"z"]] probe parse/case "hello" [some letter/lower] probe parse/case "Hello" [some letter/lower]
true
false
== false
 
@HostileFork Looks like I'm not. ;)
 
@DocKimbel 1. You're preallocating the bitset. 2. You can't use letter alone.
You can't do what we want to do, which is not allocate every bitset you might want to use up-front... nor use the word alone without refinements.
 
@HostileFork Have you benchmarked the performance impact of calling a closure instead of getting a static bitset?
 
1:18 PM
@DocKimbel It's only called once per rule segment. And I don't care about performance because if there's really a problem, and you have a case that would work fine in a static way, you can go in and do that. People aren't avoiding parse because it's too slow, dude.
 
1:30 PM
@HostileFork Don't assume you know what I think, you don't. ;-) Maybe you're missing a bigger picture. Rebol is meant to be useful and a practical language, so pragmatism is strong there (vs following academic/abstract rules for the sake of abstract elegancy).
One design pattern Carl has used is try to get the maximum features by combining datatypes (the matrices of datatypes relations per action). So often, instead of throwing an error, he tried to obtain a useful effect instead (except when an error is more helpful).
So, in case of PICK allowing logic! to be used instead of throwing an error, gives a ternary operator for free almost.
 
@HostileFork - there is long resistency of DocKimbel and Gabriele to allow stuff like to [a | b | c] .... most users, who would be able to find parse more usable having such capabilities, will be most probably left out, because there is a fear of busy loops, degrading performance, etc. As for me - I will never use regexp, because 1) I find it being a crap 2) I will never remember those cryptic patterns.
 
There are dozen of other cases like that in Rebol, which would have required dozens of additional functions and increased significantly the size of the final binary if Carl didn't do it that way.
 
As for above example, which was added to R3 parse but most probably will be ommited from Red, I can remember 3-5 users on ML, who was not able to work without having such a pattern. Well, we can say, that then parse is not for them, but I am for such an idioms, as first and foremost - noone pushes gurus to use them, even if they degrade performance ...
 
@pekr When people enjoy using a tool, and it gets popular, they buy books on how to use it more optimally. This pattern of not allowing people to "get what they pay for" and tie their hands instead into less expressive tools... imagines some worst case scenario where the person goes "oh parse is crap because it is slow".
But the rules of code optimization say: "Rule #1: Don't do it. Rule #2 (experts only): Don't do it yet."
@DocKimbel We have a better alternative with either, it looks better and doesn't require that nonsense.
>> delta-time [loop 10000 [find letter/upper "A"]]
== 0:00:00.034085

>> delta-time [up: make bitset! [#"A" - #"Z"] loop 10000 [find up "A"]]
== 0:00:00.002191
What percentage of the total time a function/closure call occupies depends on the total amount of work being done. The less total work you're doing, the more of a percentage it will be. But in any case, parse "aaaa,aaaa" [some letter #"," some letter] only calls the closure 2x.
 
@pekr You're not accurately reporting the problem, the issue is supporting such syntax in a generic way. Restricting it to literals only is okay (and I guess that's what Rebol3 PARSE do).
 
1:41 PM
Hm, wait, it's making the bitset each time. :-/ I thought closure locals had a lifetime where they were still kept after the return.
 
@HostileFork If LETTER is a closure, it's called 8 times then?
 
@DocKimbel No, it's called once on each SOME to produce the rule block, then the rule is executed.
 
@HostileFork Right.
 
Okay I haven't really used closures. How do I write this "letter" properly to keep its locals and still accept refinements?
Is that just impossible, because when you use closure it creates an instance that you have to hold onto if you want it to remember what it knew on last invocation... but by that time the refinements are gone?
 
@HostileFork Store values you want to persist in a local literal block.
 
1:57 PM
@DocKimbel Hm, there's also /WITH
 
@pekr Re-read the TO/THRU entry in Parse Project page. It's not written by me or Gabriele. ;-)
 
I never claimed, it is written by you or Gabriele. Just noted, that you both said, that it is not important feature to be added in ...
 
>> delta-time [loop 10000 [find letter/upper #"A"]]
== 0:00:00.008501

>> delta-time [up: make bitset! [#"A" - #"Z"] loop 10000 [find up #"A"]]
== 0:00:00.002114
 
@pekr I just wanted to highlight that's not just "me and Gabriele" that think it's very problematic or even maybe impossible to support in a generic way (allowing grammar rules as alternatives).
 
Okay, that's less insane. Not making the bitset every time. So just having the function logic in there means that when it's invoked (again, not on every letter match, just on every switch to a new rule, e.g. SOME) there's a bit of overhead. Not a terrible lot.
 
2:04 PM
@pekr Yes, it is not important feature to add, because you can easily write rules that achieve what you need without resorting to that. Supporting TO/THRU with multiples tokens and no grammar rules is doable, not too costly, but I maintain that the gains are discutable.
 
@DocKimbel - "Yes, it is not important feature to add, because you can easily write rules that achieve what you need without resorting to that." - and that is where you guys fail into a guru trap, not being imo sensitive enough to understand, that some ppl maight turn back, and not use parse, and hence stop using the tool altogether ...
 
@pekr +1
 
My opinion is, that you, as a guru, never need to use such idioms, as you know their impacts. I might understand, why you might be hesitant to use it - you probably fear ppl will teach bad habits, and later on complain, that parse is slow for e.g.
 
2:29 PM
Power cut in whole city...hope it will be stable now...(I hate such days)
@pekr What I consider "important feature" to add is the one that allows to do things you couldn't do otherwise. TO/THRU with multiples tokens are syntactic sugar, nothing more, so it's nice to have, not "must to have", hence, I don't consider it "important feature" per se. So, "not important" means here that it is low-priority, that doesn't mean I'm against it and will never implement it.
@pekr Ok, so now, using SOME+SKIP instead of TO/THRU is being a guru? :-)
 
@DocKimbel - yes, it is, for some. Because we already taught ppl bad habig using TO/THRU. Ppl are thinking, when e.g. parsing HTML - well, I will skipt to/thru the end of tag. But they are looing at some variants. So they end-up thinking - how do I stop, on the first occurance of a OR b OR c?
You have to teach them, that there is a SKIP. And they will ask -well, I don't want to skip one char at a time, it is slow .... not realising, that TO/THRU maight do the same underneath. So - if you want to propose alway use SKIP, be so fair, and discard TO/THRU helpers anyway ...
 
@pekr I hope that you'll then advocate for changing the PARSE documentation on Rebol web sites to put SOME/ANY/SKIP into a special "Guru" section with lots of "not for beginners!" warnings around. ;-)
 
everything I wanted to say, is in above sentence. If you are not able to understand it, then you will sit on your ML and constantly answer, how ppl do such simple stuff, as returning on the first occurance of the desired option. The truth is in the eye of the beholder is the saying. And the truth it, that we again and again and again meet with ppl requesting that. Call them stupid then ...
 
@pekr Yes, because most new users (including myself when I started) assumed that PARSE was working differently than it does. For example, the "stop at first matching" on alternative TO rules is not explicit in the docs. It's a documentation issue.
 
I wish there was a good short name for empty string. I don't like the look of "" or {}, though I prefer the latter I guess.
"" looks too much like '"'
 
2:41 PM
well, TO/THRU are the culprits. Because TO [ "a" | "b"] will return matched "a", even if it is occuring after the "b", and that is the situation, when ppl stop and try to adapt it to their needs ... suggesting them to redo it using SKIP is like telling them - parse is not for you, stupid :-)
 
@pekr Agreed, but like I said, I think it was a documentation issue in the Core manual. I remember hitting that wall, like most others.
 
bt - I proposed the function to be called FIRST [a | b | c] - but then you would not be able to use it in TO/THRU variants ...
 
@pekr That's not a bad idea. ;)
 
@HostileFork - nochar could be the name for the empty string, sounds strange :-)
Doc - how is that? FIRST maight work as a nice name, but as we don't have refinements, we can't do TO/FIRST THRU/FIRST, or FIRST/TO, FIRST/THRU ... you would have to have separate names, or use hyphens - FIRST-TO, FIRST-THRU
 
@pekr FIRST = TO, AFTER FIRST = THRU ;-)
 
2:47 PM
@RebolBot
rejoin [{This seems lame...} if false [{Something}]]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> rejoin ["This seems lame..." if false ["Something"]]
== "This seems lame...none"
 
ah, AFTER is new R3 addition? It is not in R2 parse IIRC?
 
None seems to participate a lot in things where you'd think its value of existing would be to indicate a lack of participation.
 
then yes, and even the name is imo more descriptive - FIRST ... I kind of like it ...
 
How often does one want a literal none in a join?
 
2:49 PM
@pekr It's not in R3, nor PARSE project, I just came up with it. ;-)
@pekr But then what to do with TO/THRU? Drop them?
 
There is AND, formerly named AT, so AFTER could be there too ..
 
@pekr AND is probably my mostly hated keyword name in the PARSE additions. ;) I'll make sure to find a better name in Red.
 
@DocKimbel I don't like AND either. HERE?
 
maybe it is why it was added to TO/THRU after all. Recently, IIRC, they work work only for a signle rule, so you have to do ANY [to "str1" | to "str2], which fails for most users, as described above, as it tries to always satisfy the "str1", and if found, even after "str2", is satisfied
hence TO ["str1" | "strs2"]
I can still find it being a nice idiom. Not sure, if it slows down parse, or can cause any infinite loops, but does what most ppl would like it to do, replace the usage form I mentioned above, without pushing ppl to use SKIP variant
 
I'm also curious if STORE X and STORE X: with RESTORE X would be better than using raw set and get words in the dialect for manipulating the parse position. The same reasoning for why SET X and SET X: and COPY X and COPY X: might be chosen based on different dispositions to locals gathering could apply to storing the parse position.
 
2:56 PM
@pekr I don't understand the issue with SKIP, it's one of the simplest operation in PARSE.
 
I don't like AND name for what it does ither. Maybe TRY
 
@HostileFork AND: A look-ahead rule: Matches the parse rule without changing the current position. I would propose MATCH, TRY, ATTEMPT, AHEAD, FETCH.
 
ATTEMPT is even better, albeit longer ...
 
@DocKimbel AHEAD looks like the best preservation of meaning
 
@HostileFork KISS vs abstract consistency.
@HostileFork Probably yes.
 
3:00 PM
@DocKimbel "SET word is independently still very useful: when variable localisation is not necessary and you consider SET word more readable, or when you explicitly want to avoid automatic locals handling, and set a "global" variable. Basically, it's the same as with SET 'name vs name: in the DO dialect. Both are useful." @earl, curecode That's not abstract.
 
@pekr Was AND really added specifically for supporting such idioms?
 
@rgchris ^--- AHEAD vs AND... opinion? It looks better than AT.
 
@HostileFork I was referring to your STORE/RESTORE proposition.
 
@DocKimbel Same premise applies. If you are writing a function and have a parse rule, only letting the parse position be saved with a set-word means it will be gathered. You don't have the choice.
 
3:06 PM
@HostileFork I'm not sure to understand the problem you're describing. You're referring to local vs global word usage when used in parse rules?
 
@DocKimbel Yes, if you have a parse rule in a function or closure vs. a func or a clos. Whether you want the function to specifically see the variable you are saving in as a /local might depend, as @earl said regarding SET and COPY
 
@HostileFork I don't see the problem...
@RebolBot
a: 123
foo: func [/local a][parse "x" [set a skip] ?? a]
foo
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> foo: func [/local a] [parse "x" [set a skip] ?? a] foo
a: #"x"
== #"x"
; Brought to you by: tryrebol.esperconsultancy.nl
>> a: 123 foo: func [/local a] [parse "x" [set a skip] ?? a] foo
a: #"x"
== #"x"
 
@RebolBot
foo: function [] [parse "aaabbb" [some "a" x: some "b"]]
foo
print x
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-no-value.html
>> foo: function [] [parse "aaabbb" [some "a" x: some "b"]] foo print x
*** ERROR
** Script error: foo has no value
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
3:19 PM
@RebolBot
foo: funct [] [parse "aaabbb" [some "a" x: some "b"]]
foo
print x
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-no-value.html
>> foo: funct [] [parse "aaabbb" [some "a" x: some "b"]] foo print x
*** ERROR
** Script error: x has no value
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
Anyway, the point is that if you had STORE X and STORE X: both working, you could use locals-gathering and still have a choice.
 
3:41 PM
@PeterWAWood Incidentally, I have a rebol.org colour coding experiment here: reb4.me/cc/org/values
@HostileFork Yes, possibly. None of them really 'fit' exactly...
 
@rgchris AHEAD fits because it doesn't suggest any action taken, but evokes "lookahead"
"If there's a storm AHEAD, then..." (could be plow forward into it with weather monitoring equipment, could be turn around). Things like ATTEMPT and TRY sort of suggest an action taken.
 
I'll give it a little mulling time...
It may be that I find it weird in the same way I find TO weird: parse something [to "this" "this"], it's not that it isn't valuable, just looks awkward.
 
4:21 PM
@RebolBot
compose [(none)]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> compose [(none)]
== [none]
 
@RebolBot
append [a b c] none
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> append [a b c] none
== [a b c none]
 
@RebolBot
append [a b c] [none]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> append [a b c] [none]
== [a b c none]
 
4:23 PM
I'm okay with the latter, but the former just doesn't make sense. None has this potential to be an accepted parameter that means "don't do anything", and as the evaluation result of an IF or UNLESS if the branch is not taken, I don't see why we are writing:
@RebolBot
block: [foo bar]
compose [(either true [block] [[]])]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> block: [foo bar] compose [(either true [block] [[]])]
== [foo bar]
 
@RebolBot
block: [foo bar]
compose [(if true [block])]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> block: [foo bar] compose [(if true [block])]
== [foo bar]
 
4:51 PM
@RebolBot
append [a b c] print "Hello"
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> append [a b c] print "Hello"
Hello
== [a b c unset!]
 
That works? :-/ I thought the point of unset was that it wouldn't work for things like that.
 
 
1 hour later…
5:55 PM
@HostileFork I wrote issue.cc/r3/1879
 
@Ladislav Hm, interesting... so you would propose that true intersect true would be true while none intersect [foo] would be an error?
I do feel that the AND/OR/XOR not allowing the "conditional expressions" hasn't really offered an advantage I can see.
 
6:29 PM
@RebolBot
print ajoin [<a> <b> <c>]
print rejoin [<a> <b> <c>]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> print ajoin [<a> <b> <c>] print rejoin [<a> <b> <c>]
<a><b><c>
<a<b><c>>
 
@RebolBot
source rejoin
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> source rejoin
rejoin: make function! [[
    "Reduces and joins a block of values."
    block [block!] "Values to reduce and join"
][
    if empty? block: reduce block [return block]
    append either series? first block [copy first block] [
        form first block
    ] next block
]]
 
@BrianH why doesn't rejoin call join? This is weird. I don't really care for the names AJOIN or REJOIN either. Is there any more sensible construction of this, like axe AJOIN... rename JOIN to ADJOIN, and then make REJOIN take the name JOIN while being built on top of a call to ADJOIN?
And I think rejoin [<a> <b> <c>] or whatever you call it (the thing we teach people to use to glue together things) should make either <a><b><c> or <abc> but definitely not <a<b><c>>.
("adjoin" is an actual word, addressing specifically two things that are adjacent being joined together, whereas "join" is more general. I don't think the "re" in "rejoin" immediately evokes reduce, but rather "do it again".)
 
7:09 PM
@HostileFork But I bet you prefer conditional NOT
Programming languages do not need logical values, they just need conditional values.
Rebol is the only language I know not having conditional operators
 
@Ladislav Hm? Not really... I think it should work the way the rest do. You've pointed out that there's complement as an alternative which would fail on random data like say complement [a b].
 
@HostileFork What do you mean by "not really"?
 
@Ladislav Oh, you said "but I bet you prefer conditional not". Yes, I do. You don't?
 
I do too, I prefer conditional operators
 
Well it looks good to me. With IF, EITHER, and UNLESS being willing to implicitly use to logic! it seems those operations should too.
 
7:16 PM
@HostileFork IF EITHER and UNLESS use conditional values
(no wonder, that is how conditional values are defined)
Also NOT uses conditional values, that is why I call it "conditional operator".
But, as I said, AND and OR are not conditional operators
Neither is XOR
 
Okay, however you want to say it, I think the point here is agreement. TO LOGIC! is being brought under the same umbrella such that TO LOGIC! 0 is true. And thus, making AND, OR, XOR, NOT, IF, UNLESS, and EITHER all operate under the same consistent way of handling "conditional" values which is also consistent with TO LOGIC! is good.
When people make a new data format which consists of Rebol-structured data (but is not intended to be run via DO)...how common is it to make a header for it? Is REBOL [] used or MYFORMAT [] used?
Since LOAD does a bunch of binding work, should you not use it if the file just contains data?
 
@HostileFork I do not propose INTERSECT to have a property you mention. I do propose AND and OR to be conditional exactly like NOT is.
 
@RebolBot
print complement false
print complement [a]
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-expect-arg.html
>> print complement false print complement [a]
true
*** ERROR
** Script error: complement does not allow block! for its value argument
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
Is there a reason why complement would allow true/false but intersect/union wouldn't?
 
7:27 PM
Or, if that is not acceptable then I propose to just define new, truly conditional operators.
@HostileFork I am for consistency when possible, but I am also a practically oriented person when programming. That is why I do not like Rebol being the only programming language not having conditional operators. The additional properties of COMPLEMENT, INTERSECT, etc., are below the resolution in this case.
 
=> "no particular reason, but I don't care enough about it to evaluate the pros and cons for that detail; it may be better or worse, but either way it matters a lot less."
Which is fine. Just wondering.
 
Understood. I am having a different set of priorities, maybe.
@HostileFork Also, there may be a reason, but I may not know it, exactly like you (do not know it)
I am not the main architect of Rebol, I am just a user trying to propose my opinions here and there...
 
7:47 PM
@Ladislav At this point in time, we the handful are the only architects of Rebol. :-/ And it is good that we are getting some momentum in starting to get at these core questions.
 
posted on October 08, 2013 by fork

[Comment] This example: if (true? value1) AND (true? value2) OR (true? value3) [] Is a very common one, and was an annoyance to me until I started using ANY and ALL. After which, I rarely touched AND/OR. But despite the flexibility ANY and ALL provide, there are some cases that would read better infix and without a block. Moreover, this is something every new user would struggle with prior

 
8:07 PM
0
Q: How should a Rebol-structured data file (which contains no code) be written and read?

HostileForkIf you build up a block structure, convert it to a string with MOLD, and write it to a file like this: >> write %datafile.dat mold [ [{Release} 12-Dec-2012] [{Conference} [12-Jul-2013 .. 14-Jul-2013]] ] You can LOAD it back in later. But what about headers? If a file contains code, i...

 
 
2 hours later…
10:20 PM
0
A: How should a Rebol-structured data file (which contains no code) be written and read?

rgchrisRebol data doesn't have to have a header, but is best practice to include one (even if it's just data). Some notes: SAVE is your best bet for serializing to file! or port! and has a mechanism for including a header. MOLD and SAVE both have an /ALL refinement that corresponds to LOAD (without, ...

 
 
1 hour later…
11:20 PM
@RebolBot
print mold [[#[none] none #[unset!] #[true] true #[false] false]]
print mold/all [[#[none] none #[unset!] #[true] true #[false] false]]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> print mold [[none none unset! true true false false]] print mold/all [[none none unset! true true false false]]
[[none none unset! true true false false]]
[[none none unset! true true false false]]
 
funny
Can somebody explain the result to me?
 
@Ladislav It's how the code is written. I'd imagine the ideal would be should be #[none], #[unset], #[true], and #[false]... distinct from the words. Is there a reason why it's #[unset!] and not #[unset]? It's not a type.
 
@HostileFork See also #[datatype! unset!]
or #[url! "http://"]
- in the construction syntax it is usual to have a datatype name as the first item
@HostileFork "It's how the code is written." - sure, but I am at odds why the code is written so that it does not use the actual source I wrote?
 
11:38 PM
@Ladislav Hm, so should it be #[unset!], #[logic! true], #[logic! false], #[none!] then?
 
Well, #[none!] works as far as I know
Regarding logic values - there was a good reason to provide a short syntax for them
(that is what I suppose)
Also, #[true] does not conflict with anything else, so why not?
 
@Ladislav Do #[unset] or #[none] conflict with anything?
 
@Ladislav I think the construction literals are converted before evaluation by Try Rebol.
 
#[none] does not conflict with anything either, and it actually exists as a possible syntax. #[unset] does not conflict with anything either, but I suppose it is not necessary, just one of the #[unset!] or #[unset] should suffice.
@rgchris Yes, that is likely, but why?
 
I'd vote for #[unset] for consistency.
@Ladislav You'd have to ask Kaj...
Actually, perhaps not—it might be a RebolBot issue...
 
11:48 PM
@rgchris I do not mind much, consistency is missing anyway, cf. #[datatype! unset!]
 
@rgchris Hmm, either I overlooked it there, or the reason is not in the file
 
@Ladislav The distinction for me is that for none, true and false are only represented by their corresponding words (unless aliased). Perhaps that distinction should go for datatypes too.
 
@rgchris Well, but #[unset!] does not have a corresponding word
 
@Ladislav As I see it, the statement is loaded (not in that file) and molded (using mold/only, not mold/all).
@Ladislav Well, which would be more appropriate—should #[unset!] refer to a datatype! value or an unset! value? (or neither)
 
11:57 PM
I see the principle expressed in #[url! "http://"] as sound. That would correspond to #[unset!], #[none!], and #[logic! true], but I agree that #[true] is more useful since it is (significantly) shorter.
 

« first day (1073 days earlier)      last day (2707 days later) »