« first day (1580 days earlier)      last day (2200 days later) » 

12:00 PM
So it doesn't help very much with the example that @HostileFork posted: offscreen bob: <emotion> "text"
 
It helps alot, because @HostileFork now has a syntactic possibility to discern between the two different meanings.
 
@earl How?
 
offscreen bob: <emotion> "text" vs offscreen^(space)bob: <emotion> "text"
 
(First example: length 4. Second example: length 3)
 
@earl So as I said, it doesn't help with the example, unless he rewrites it.
 
12:02 PM
@rebolek It does help with the examples because he is able to write them at all.
Of course he'd have to change how they are written, that's the whole point of this discussion.
Problem is, at the moment he cannot do that at all, because there is no way to lexically express a word containing spaces (or other special characters).
 
@rebolek But my example only existed to counter your response. You suggested that if I wanted a dialect design in which there were spaces in character names, then PARSE could take care of that... I'd simply notice when a word was followed by a set-word!. I pointed out that perhaps that's a solution that works in the narrow case, but I might actually want character names to be atomic inside a set-word! to free up leading words for other things.
 
So his dialect still won't be able to use offscreen bob: <emotion> "text".I really don't see the benefit of this.
 
@rebolek It will absolutely be able to do so. What is it that you are missing?
"offscreen bob:" will be the offscreen directive combined with the bob character.
 
@earl It won't be, unless he escapes the space, right?
 
"offscreen^(space)bob" will be no directive and the "offscreen bob" character.
@rebolek Being able to escape the space is the whole point of this discussion, or isn't it?
 
12:05 PM
@earl I understand that. But who's going to use name "offscreen^(space)bob" instead of "offscreen bob" ?
 
@rebolek @HostileFork is, for example.
If only he were enabled to use it at all.
 
hehe :-)
 
@rebolek I am (well, I actually want offscreen^_bob...because I'm writing "source code". I'm willing to accept the limits of the medium to get the benefits. Just as I'm willing to accept escaping quotes in strings.
 
you are missing what is Rebolek trying to say, and Rebolek is missing, that Hostilefork is NOT going to use "offscreen bob", but offscreen^_bob instead
 
If you're saying that designing a script language for a general audience in which spaces have to be escaped is going to be a difficult product to take to market, certainly.
I do not think the average non-programming screenwriter is going to be downloading sublime text and learning the finer points of Ren notation just to use my tool.
 
12:08 PM
@pekr That might be true.
 
@rebolek Just as you are perfectly willing to write an escape such as e.g. {foo^{"bar"} sometimes.
Or use the %"foo bar" escaping mechanism for files containing spaces (or %foo%20bar, don't know which you actually prefer :)
 
But what I need, if Ren is going to be a backend and a sort of "common ground" between a front end and someone who might actually crack open a text editor and not see gibberish...
 
@earl Of course, it's a string, not a word
 
@rebolek What's the difference?
You want to write a particular data element which you can't write at all without resorting to an escape mechanism.
 
Is that the format must be flexible enough to encode for both sides. Remember what we're trying to do: not be XML.
 
12:09 PM
What Rebolek meant was, that ok, we will have green^_alien now, but we still are not able to load 3rd part "green alien". The trick is - we are not supposed to :-) The only thing we want here is to allow to use spaces. And those who want that, will simply escape it via ^_ ... and that's all
 
@pekr Yep.
And while doing so, we keep and even enhance the great Rebol utility of using different datatypes to discern between different things.
 
@earl Well put.
 
Of course one could always just write "bob" "emotion" "text" and then say that the first string is the character, and the second string is the emotion, third string text.
Perfectly fine. Perfectly doable in every other language on the planet.
Not so nice dialect design.
 
Well, I feel dumb anyway - not understanding the other topic - what is all the fuss about the construction syntax :-)
I somehow got lost in the translation :-)
 
>> load "#[string! {Hello}]"
 
12:13 PM
; Brought to you by: try.rebol.nl
== "Hello"
 
>> load "# [string! {Hello}]"
 
; Brought to you by: try.rebol.nl
== [none [string! "Hello"]]
 
@pekr Ignore the construction syntax debate for now :) That is just an attempt at making construction syntax looking nicer.
But the primary driving force behind this is being able to escape words in a nicer way, and we have a better alternative for that now.
(And yes, there's also a syntax consistency issue. Also not too important at the moment :)
 
@earl I think, in a way, that @rebolek's resistance is actually sort of part of the zeitgeist of the reason why it took us so long to find this.
 
I think, it was a missunderstanding ...
 
12:16 PM
@HostileFork LOL, you're so funny.
 
@HostileFork Maybe. But I think in this particular case, @rebolek's resistance is really just a communication issue / misunderstanding.
 
@pekr Yes, I don't get how ^_ is space more than I don't know plain _ is.
 
Somehow, some part of the explanation side-tracked a thought, and it seems it's quite difficult to re-align our trains of thought.
Hrmpf, I thought ^(space) already worked as an escape inside strings, but it seems it doesn't. So maybe that adds to the misunderstanding as well.
Replace ^(space) with ^(20) in everything I wrote above, if that helps clarify things.
>> "foo^(20)bar"
 
; Brought to you by: try.rebol.nl
== "foo bar"
 
^_ is an additional proposal as an escape for space.
Along the line of ^/ for newline and ^- for tab.
 
12:21 PM
Saying that you can use spaces in words (with this proposal), you just have to escape them is like saying that you can use numbers at the beginning of word, you just have to spell them.
 
@rebolek How so?
 
>> one: 1
 
At the moment, you can't even escape spaces in words.
 
; Brought to you by: try.rebol.nl
== 1
 
See? Number at the beginning of the word.
 
12:22 PM
With this proposal, you could also use numbers at the beginning of a word.
@rebolek I don't see a digit at the beginning of that word, no. I see the alphabetic character #"o".
 
@earl And I don't see space in foo^_bar. Just an escape character.
 
@rebolek Right.
 
@rebolk When processing a dialect, you don't always evaluate. And as you've noted it's not always safe to do so. Hence why you might have a refinement like /SAFE.
 
So.
 
@rebolek But if you ask that word its spelling, you'll get back a nice "foo bar" string, containing a space.
Are escapes really that difficult to understand?
Or if you write that word in construction syntax, you'd get #[word! "foo bar"]. See the space?
 
12:24 PM
So it will MOLD to "foo bar" but won't load back from "foo bar"
 
@rebolek No, it will most definitely not MOLD to "foo bar".
Unless you want to keep MOLD as broken as it is.
 
@rebolek See the update to the ticket: curecode.org/rebol3/ticket.rsp?id=2195
 
It will either MOLD to the escaped syntax (foo^_bar), or maybe it'll even mold to construction syntax (#[word! "foo bar"]). Most likely the former for MOLD, maybe the latter for MOLD/all (but then, maybe even the former for MOLD/all as well).
And if we could fix R2's MOLD, we'd do the same there.
 
So the escape character will never turn to an actual space?
 
@rebolek It will when you ask the word its spelling (TO-STRING, or a hypothetical SPELLING-OF).
 
12:29 PM
@earl But I won't be able to match foo bar as one word?
(in source)
 
@rebolek No, of course not. Or how would you distinguish that from two words?
You can of course use PARSE to mangle and reasseamble already LOADed data as you wish.
 
@earl I'll note I've included SPELLING-OF in Ren Garden, and SPELLING-OF "FOO" is the 3 character string FOO and SPELLING-OF <FOO> is the 3 character string FOO, as well as SPELLING-OF QUOTE FOO: or SPELLING-OF QUOTE 'FOO etc.
 
rebol2> to-string to-word "foo bar"
 
; Brought to you by: try.rebol.nl
== "foo bar"
 
@HostileFork I am aware of that, yes.
 
12:32 PM
Whereas TO-STRING includes the suffix. This raises the question if to-string quote foo^_bar^_baz: should give you "foo bar baz:" ... it would seem to be what you meant.
You're just "stringifying", and once you TO-STRING something you have no guarantees of that being loadable anymore
 
I don't think the question of whether the prefix/suffix is included in the spelling is material for the discussion at hand.
 
Well, I was bringing up more the latter point.
Since you were talking about stringification and that it would have the spaces, just pointing out an epicycle of that.
Though in the case of the character name, that's exactly what I would want if I TO-STRING it.
 
The important point for the current discussion is that a real, unescaped space is of course part of the string that corresponds to the spelling of a word containing a space.
 
Yes.
 
rebol2> parse [foo bar] reduce [to lit-word! "foo bar"]
 
12:35 PM
; Brought to you by: try.rebol.nl
== false
 
Would be the same under this proposal. A word containing a space is definitely not equal to two words separated by space.
 
@rebolek If you're looking for a single word that incidentally contains an embedded space, and try to match it against two individual words, it cannot possibly match. You were looking for one word. All that will match will be a similarly escaped word.
 
So of course, parse [foo bar] [foo^_bar] would not match.
 
parse [foo^_bar] reduce [to lit-word! "foo bar"] would match.
 
So it's more like word with caret followed by underscore in it, that word with space in it.
 
12:38 PM
Except for the part where it's not like it.
 
No, where do you get that idea from?
 
parse [foo^_bar] reduce [to lit-word! "foo^^_bar"] won't match.
 
Would it help to understand the point, if we were to use construction syntax instead of that proposed escape mechanism?
parse [foo bar] [#[lit-word! "foo bar"]]
Do you see the space inside that word?
I'm sure it's also quite easy to see, that "foo bar" == to-string #[word! "foo bar"], right?
 
@rebolek Perhaps a confusing point is that this is a real change. Carets as you know them would no longer be available as they have been as ordinary characters in words.
 
Now instead of using construction syntax #[word! "foo bar"], you could use an escape syntax to express the same word: foo^_bar.
 
12:41 PM
It really means "forget everything you knew about carets" (except, for the fact that what's really happening is you're just making what you know about carets in strings apply to words.)
 
@HostileFork Wonderful.But I will be able to use space, that's not quite a space.
 
@rebolek It is an absolutely perfectly fine space.
 
@rebolek Well, ^/ is not quite a newline either.
 
Just like %20 is a space in %foo%20bar.
 
But when you put it in a string, and that string is understood by the thing-that-understands strings, it knows you mean it's a newline.
One character and not two. That's escaping for you.
 
12:43 PM
Or like ^(20) is a space in "foo^(20)bar".
 
48
A: How do I split a string??? Help plz? (code trolling)

Dr. RebmuC My homework assignment is take a string and split it into pieces at every new line. I have no idea what to do! Please help! Tricky problem for a beginning C programming class! First you have to understand a few basics about this complicated subject. A string is a sequence made up of onl...

 
They are escaped spaces, sure. Doesn't make them any less spacy.
 
I just realized that with the StackExchange deletion mafia going around I should cache that one.
 
@earl I can read a directory and filemames with spaceare escaped.
Unlike words with spaces
 
@rebolek And you can GET and SET a word with spaces escaped.
 
12:45 PM
They must be escaped already.
 
No difference here.
 
In @HostileFork example, he stated that offscreen bob: is one (set-)word. Which is false from what you're saying.
 
It is two items, one word and one set-word.
 
I agree
 
@rebolek Since we're on the record, care to find where I said that?
 
12:47 PM
So does @HostileFork.
@HostileFork never stated that this is one set-word, he actually only pointed out that your PARSE example would pick that up as one word.
Whereas he might want to be able to design his dialect so that it means something differently.
In general, what we already discussed at length before.
@HostileFork wants a mechanism to be able to express precisely this disctinction.
offscreen bob: -> word, set-word
offscreen^_bob: -> one set-word
Currently, that's not possible to do in Rebol.
The long-winded road to be able to do this is to simply allow spaces inside words (currently forbidden by R3, but not by R2 and Red) and then use plain construction syntax:
offscreen bob: -> still one word + one set-word
 
Or he could have offscreen_bob:...
 
#[set-word! "offscreen bob:"] -> one set-word (with spelling "offscreen bob").
And then there's an additional idea to make that even more friendly without having to resort to long-winded construction syntax:
offscreen bob: -> still one word + one set-word
offscreen^_bob: -> one set-word (with spelling "offscreen bob")
@rebolek He could, but that's not a word with a space inside, that's a word with an underscore.
He could of course mutilate his dialect and say that "wherever I write _ I really mean space".
But as mentioned before, that's not a good general solution.
(Neither is it an elegant one. But if one likes it, it is still possible to do it, with or without that proposal.)
Not general, because every person designing dialects potentially has to come up and re-invent escaping mechanisms. Why not provide them in the language ready to be used? Just as we do with escaping for strings, files, urls, etc.
 
@rebolek I did that with hyphens. Because I had to. And that's code I have to write and now I can't pass things around and just have them be what they are. There's this whole translation process when what I really wanted was spelling-of and not have to worry about it.
So the point is what earl said. Constant reinventions of solution to the same problem. Imagine if there were no escaping in strings at a language level and everyone wrote their own.
As instances go, dialogue in Draem is actually not necessarily a super compelling example, because I'm dealing with the web domain and I am generating URL slugs where I have to put hypens in it anyway. Sometimes I want it with hyphens, sometimes with spaces. So I'm not all that annoyed at taking the hyphens out, and it's easier to type.
It's actually a case where "bending to the rules" doesn't bother me so much. But in part what doesn't bother me about it is because I can, since all the requirements come from me and I can do whatever I want. I'm not interfacing with any prior existing thing...I made it all up.
If you control it all, you're going to probably avoid escaping. Rebol programmers hate escaping and love the curly braces for strings.
If you decided #foo meant identity for a div, even if HTML allowed you to use characters illegal in a word...you never would. And if there were legal ANY-WORD! characters that were illegal in div identity, you'd not use those either. You'd just stick to the intersection.
We're talking about a common way that you can take for granted when you hit a case where more strings are permitted in the thing you were using the word to represent, than a Rebol word typically would allow. And if you hit that case, you have a fallback.
It's not about changing the way anyone programs today, or telling you should start escaping in your code for no good reason "because you can". It's just expanding options. No one in their right mind is going to write foo^_bar: 10 instead of foo-bar: 10 on the abstract notion that "words in spaces are good!"
 
 
1 hour later…
2:24 PM
Sigh. I just realized the caret proposal affects Rebmu. :-( Always a sad moment when one of my proposals messes with a Rebmu trick.
 
 
2 hours later…
4:01 PM
Interestingly, though, I had bumped things around so that L? could be LENGTH? ... which meant I couldn't use L? for lesser. So I was using L^, and that moved several things around. But with LN being LENGTH, then L? becomes LESSER? and most of the caret-becomes-escape damage to Rebmu goes away.
I know you guys were worried, but looks like we're dodging a bullet here... :-P
 
4:14 PM
@RebolBot
^-: tab ^_: space ^M: #"^M"
a: {It hadn't} b: {occurred to me...} c: {we can make this aspect} d: {work today!}
print [^- a ^_ b ^_ c ^M d]
 
; Brought to you by: try.rebol.nl
     It hadn't   occurred to me...   we can make this aspect
 work today!
 
So we can get ^_ ^- and ^M today, but ^/ is a no-go because it's a path. :-(
 
we can propose to change the path to more natural . notation known from other languages, but we would most probably risk Carl exterminating us :-)
 
As NewPath shows, I actually think the / is natural.
 
Of course / is more natural, it allows you to mix path with file.
 
4:31 PM
@HostileFork While I am thoroughly enjoying the resulting discussion, I am sorry to report that it is not what I meant at all.
 
@MarkI Oh. Well then, I had the interesting idea of the week. :-)
 
Wait, my idea's not out there yet ...
But I'm waiting for next week at least!
@earl Absolutely fine by me. But why not create one? Why repurpose an existing syntax?
This issue may already be addressed. I like the '...@[]' syntax.
 
@MarkI You will still be able to say map@[...] if you want under the proposal. It's just if one is going to pick a meaning for @[...] it becomes more "JSON-competitive" if map goes ahead and takes that. It might not seem quite as good as their {...}, but the hope is that everything else makes up for it.
It simply isn't competitive for JSON to say [1, 2, {foo: 10, bar: 20}] and then try and say "No we're more readable!" with [1 2 #[map! [foo: 10 bar: 20]]]
Might stand a chance with [1 2 @[foo: 10 bar: 20]]
 
@earl Dot is already a word. I know because it buggers my BNF :(
 
@earl Actually, the most common type should probably take parentheses for the above. If it's not code, then that will look more heterogenous.
So [1 2 @(foo: 10 bar: 20)]
 
4:39 PM
>> .: "stop annoying me" print mold .
 
; Brought to you by: try.rebol.nl
"stop annoying me"
 
If all you have are blocks and maps in many contexts, then using a deviating delimiter makes more sense.
An interesting thing about these discussions is, that should any of this become relevant in the future, it's all on the record and people can go read things like "the day it almost went wrong". Or perhaps "the day it did"
From Tony Hoare: "I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement."
"This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years."
Anyway, I think with the above...it can help with closing up that gap we've been fretting over about Ren.
Then lone # can be a NONE! literal. I think that's a good use for it. And with stuff after it, then it's an issue
 
 
2 hours later…
6:55 PM
@HostileFork While I like this argument HF, I thought everything was a string in JSON; isn't its example more like ["1", "2", {"foo": "10", "bar": "20"}] I'm just asking.
 
@MarkI Yes you're right about the keys (JSON enforces that, not JavaScript), but you can use numbers or true, false, null as values in the JSON spec: json.org
So [1, 2, {"foo": 10, "bar": 20}]
And if there wasn't already a good enough argument for why one needs escapes in words... to be competitive with [1, 2, {"foo bar": 10, "baz mumble": 20}] it's important to have [1 2 @(foo^_bar: 10 baz^_mumble: 20)]
Of course, generally putting spaces in keys in JSON is frowned upon, for similar reasons to why Rebol programmers wouldn't want to do that. JavaScript programmers would rather you use underscores so they can say obj.foo_bar instead of having to write obj["foo_bar"]
So you wouldn't expect to see that often. But if you were translating a JSON message with a space in it, it would suck to say "oh. we can't translate that to Ren, sorry. No equivalent."
"We'd rather not. But we can do that." is always a better answer. See also: math [1 + 2 * 3]
@MarkI If you're looking for a fun project, actually: curecode.org/rebol3/ticket.rsp?id=2120
Someone's gotta write it.
 
7:23 PM
@HostileFork You can have a map! with string keys, if you need keys with spaces.
 
@rebolek We're going to be back on the same thing again, which is, types matter in Rebol, a lot. You pass a string to a routine it will act differently than if you pass a word, or a URL, or something else. Note earl's comments above:
7 hours ago, by earl
Of course one could always just write "bob" "emotion" "text" and then say that the first string is the character, and the second string is the emotion, third string text.
7 hours ago, by earl
Perfectly fine. Perfectly doable in every other language on the planet.
The issue is, that just because occasionally... even just once, I might have a situation with a space
It shouldn't fundamentally force my hand about the type I use for things.
 
@user561577 Hello there. Interested in Rebol and Red?
 
7:43 PM
So now I've gotten rid of all the caret usages in Rebmu as they used to be. But this leads to a new question about how to handle escaping in the unmush; by the time I get the characters for processing I wouldn't see any carets. And if you don't use any uppercase characters it has to be the same, so pr[a^/b] wouldn't split that. Hm. I guess newlines and tabs etc. count as "characters with no case" and would follow the same rules as splitting.
So if you write pr[a^/B] what comes in has a SPELLING-OF that is "a B". But that has to be broken up into three words, one of which is the word with the spelling " ". So it would be "as if" you had written pr[a ^/ B], however since this is happening inside the already loaded code you really are just doing TO-WORD on the " ".
So not that complicated. But again, it can't actually be done right now with a hack, because that loads as a PATH! at present.
It does suggest though that maybe with the role of / being so special, it might not be the ideal newline character. Not that it couldn't be allowed (it's not a technical barrier, just a visual one), but maybe an alternative would be less likely to be confusing in paths.
It's not like it's really going to come up often, because the only word you would likely want to put a newline in usually would be the "newline word" and it would clearly stand on its own with spaces surrounding it...(just not in Rebmu)
Newlines in words are something very unlikely to be coming from external sources in dialect design. It would be a serious edge case.
 
@HostileFork Actually, if you want compatibility with JSON, you SHOULD use string keys.
 
@rebolek It isn't necessary with this proposal, and think of what that would be like. One has to look at it concretely. [1 2 @("foo" "bar" "baz" "mumble")]
The reason that set-word! is needed there is to break the keys and the values up as distinct types for visibility. [1 2 @(foo: "bar" baz: "mumble")]
Which brings us back to your refrain of "just make it a string" being a poor fit, once again.
It weakens the notation, it forces your hand where you don't want it to go.
Without some delimiter, the types are what you have to cue on. And allowing escaping in the words lets you keep that AND have JSON compatibility
Note what I said about it not happening often. JavaScript programmers don't want spaces in JSON keys. They can technically happen, but are discouraged. They don't use hyphens either because then they can't write obj.some-key because JavaScript will see that as subtraction.
They don't want to be forced to write obj["some-key"] or obj["some key"] any more than you'd want to write obj/some^_key
Most JSON keys are separated with underscore. Which will work fine in Rebol with no escaping. It's just about having full coverage if you meet one of the atypical keys and not having it break the whole thing.
In fact, the reason JSON has to put all those keys in strings, even when JavaScript doesn't require it, is just to make it systematic because they lack this very proposal. This is what would give Ren the leg up. Full JSON compatibility, good looking, and you're not putting junk in quotes all the darn time.
I wonder if between all these ideas... like saying xxx{str}yyy is not the same as xxx {str} yyy (it already is not, e.g. #{01} vs # {01}), if any space is jumping out for hexadecimal integer literals or other things that seemed hard to wedge in before.
0x{AE} and 0x{AE1020BD} for instance, to pick something random and C-like. Not ideal. Just raising the question.
@earl @rgchris --^
 
8:34 PM
posted on February 27, 2015 by fork

[Issue] When searching for a good hexadecimal literal notation in Red, it was challenging due to saturation of the notational space. (For instance: the idea of 0x10 could not work to be a hex byte for 16 because that is a PAIR!) Recent discussions questioning the value of `abc{def}ghi` being the same thing as `abc {def} ghi` have not shown it's not true (consider how `#{01}` loads vs `# {01}`

 
The idea of @{set-word with spaces}: working, along with :@{get-word with spaces} and '@{lit-word with spaces}... and @{word with spaces} could still be good, and probably be fit in with ISSUE! and REFINEMENT without breaking anything. (Although in my word REFINEMENT is a two element path led by a NONE!)
 
@HostileFork What's wrong with 04D2h hexadecimal notation that's available in Red(/System)?
 
@RebolBot do/2
load "04D2h"
 
; Brought to you by: try.rebol.nl
== none
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/syntax-invalid.html
    *** ERROR
code: 200
type: syntax
id: invalid
arg1: "integer"
arg2: "04D2h"
arg3: none
near: "(line 1) 04D2h"
where: none
 
@rebolek That notation is on conflict with words.
 
8:43 PM
@rebolek I was under the impression that Red/System used LOAD.
 
(Which you can avoid by padding with a leading zero. Ugly.)
(... is in conflict with words.)
 
 
1 hour later…
10:00 PM
@earl Gotta ask. What wouldn't be ugly? Telepathy?
 
10:38 PM
@rebolek And have those keys be case sensitive :(
Is there any performance cost to adding escapes to words?
Incidentally, one argument for using #[...] for map! and switching construction syntax to @[...] or @(...) is that there is a consistency in using #{...} for binary!.
@HostileFork It's a shame that there was no constraints on keys in the original JSON spec—just because JavaScript allows spaces in keys doesn't mean it's a good fit for an exchange language.
@HostileFork Another option is: 0hAE1020BD
 

« first day (1580 days earlier)      last day (2200 days later) »