World: r3wp
[!REBOL3-OLD1]
older newer | first last |
Oldes 11-Aug-2009 [16572] | *wish* |
Pekr 11-Aug-2009 [16573] | First plugin example posted to Chat. You can get it going to: 1) chat 2) 5045 3) get * |
RobertS 11-Aug-2009 [16574x2] | For literal string delimiters, {~ followed by a space seems safe as I am unaware of where ~ is used followed by a space and at the other end I cannot think of where tilde is used followed by a closing curly brace. Having Rebol always test for nested curl-braces in curl-brace values makes Rebol as difficult for my project as is Tcl - for the same reason. Worka-arounds abound but the result has such poor usability and readability as to be unusable. |
But I will resort to ICON or ObjectIcon or UNICON before I resort to PERL ;-) | |
Gabriele 12-Aug-2009 [16576x4] | If the {} are matched you need no escaping. |
if they are not, you just need a ^ | |
how is that crazy? I don't see any other way... | |
What are you guys proposing? | |
Anton 12-Aug-2009 [16580x2] | I think they want a multi-char delimiter so that the text inside needs much less escaping (or none?). |
For example, I think RobertS might be happier if a new special type of string which is delimited by ~{ and }~ was added to Rebol. In the content, single braces } or single tildes ~ would not need any escaping unless they happened to be together so that they look like the ending delimiter. Or maybe no escaping is possible/necessary in such a string. But now I'm also thinking of the start and end unique key strings used to delimit email attachments... | |
Oldes 12-Aug-2009 [16582x2] | Gabriele, the problem is, that if you for example want to form JS code from REBOL, you will hardly have matched {} pairs. At least that's my experience. What Robert wants (and I second that) is something like "heredoc" notation. http://en.wikipedia.org/wiki/Heredoc |
The wish is submited here http://curecode.org/rebol3/ticket.rsp?id=1194 | |
Pekr 13-Aug-2009 [16584x2] | A77 released - so, we got R3 extensions now :-) More here: http://www.rebol.net/wiki/R3_Releases |
3 new blogs posted ... | |
Gabriele 13-Aug-2009 [16586] | Hmm, scripts would too easily get "messed up" (that is, very unreadable) with Heredoc or similar stuff. maybe we could use #[{ ..... }]# for that... I'd still rather use external files for long strings, and use escaping for short strings (in other languages you have \" everywhere, so why bother with a couple ^{ ?) |
Anton 13-Aug-2009 [16587] | Gabriele: Heredoc was suggested *because* RobertS's script was messy. Maybe *you* would rather use external files for the situation you imagine RobertS is in, but I think you're not really trying to put yourself in his shoes. Moving stuff out into external files can create its own problems. The advice to "just use an external file" suggests a deficiency in the language. (One day we may not be using files. I hope sooner rather than later.) |
RobertS 13-Aug-2009 [16588x2] | A server-side scripting language which cannot handle literal strings - and especially one that claims to be Unicode - has to be excluded from consideration for templating web content which is expressed in any other langauge which uses curly braces. I told BrianH that the red flag here should be Tcl as Rebol shares this with Tcl. Literal string are literal strings. Period. No if's and's or "that might be my curly brace in there" ... Unless you dream of a Rebol-only world - and that fantasy should have passed some years back. This falls under the heading of folly - a topic too often neglected. Folly in a meritocracy usually requires some individual to speak up. But the folly of meritocracies is that to be heard taht individual would already have to be playing within those constraints. We see this in schools which graduate top people distinguished for inidividual effort who then do not fit well into teams. They did group work in college by being the one who saved the group from failure by ... their individual effort. For me this will be what makes or breaks my involvement with REBOL. I could not wait for REBOL4 and hope for change then by getting into the merit circle. My outside voice would have to be heard before it is too late. Tcl as the do-all is folly. As nuch as I admire OOTcl, the XOTcl IDE and Expect. I cannot use Tcl with "balanced brace" foolishness. Of course if we all adopt XML and abandon scripting in non-XML languages ... So We have comment { } and that was a mistake: it should have been symmetrical as in c{ comment here as literal with } or whatever }c And that is water under the bridge. We cannot be UNICODE and claim that we must escape a certain pair of characters if ithey are in a literal string. That is silly. Ludicrous. Folly. A literal string is a data value where you do not get to peek. Imagine a proxy object that said: "I will be your proxy only if you promise that when the real object appears it does not contain [ folly happens here ] " Many forms of "catch-22" in the world of beaurocratic regulation have a similar pattern. I am no expert on unintended consequences, but requiring that some pair of characters be escaped in otherwise literal content has consequences for TEMPLATE value TEMPLATE There should be a lesson there: some markup must be arbitrary and the choice will matter. { and } are the wrong choice. At least the terminal markup must be "sacrificed (it will always have to be escaped so pick carefully. [{ is a bad combo for JSON so #[{ looks worrisome to me. I propose lit |ls# and_content_then #ls| Someone shoots that down and we inch towards a suitable result. Not perfect. But usable. { and } are not useable in the real world on the server-side if rebol is to play a role with other languages. Play nice. Please. |
lit_str1: lit |ls# the word lit indicates that what follows is an unconditional literal string much as comment indicates ignore only this is a value ; when necessary use the UNICODe equiavaled: note that the markup is symmetrically reversed as we end here #ls| | |
Pekr 13-Aug-2009 [16590x2] | RobertS: not much into that topic, but - your note that #[{ is worrisome for JSON sounds strange. So we should use obscure syntax to support some JSON or what? Then comes someone next who uses something else, and we will give-up the option too? |
excuse me, but what is wrong by escaping by ^{ and ^} ? In R2, left curly brace escaping does not work in console only, but script being run from file (which is case on the server anyway) is OK. In R3, which soon will be ready to replace R2 for such scenarios, it works even in console. But probably I am too dumb to understand the issue involved :-) Could someone please give me a snipped of some quoted JS or other code, in order to get the issue? Would like to try the headache myself :-) | |
RobertS 13-Aug-2009 [16592x4] | What is obscure about a syntax which permits literal strings to be literal strings? Try assigning set lit "{test} {" in your favorite Tcl interpreter. I am not a JSON expert but [{ looks like JSON to me so #{[ "looks worrisome to me" JSON or YAML or something other than XML is going to be important whether REBOL likes it or not. Take RDF as one exmaple ( I prefer Topic Maps - please do not attack the example, but the isea ). The fact that most people seem to think that RDF is XML does not make it so. Tim Berners-Lee prefers some form of Triple notation for RDF. Not XML. As soon as a notation uses curly braces we have a problem using Curl on the server-side. Please don't point to QM. IT is not just tightly coupled to HTML it is married to it. The web is not HTML it is HTTP with Content-Type: set in the response header. If that content type uses curly braces we have to start escaping characters in Rebol. Awkward templating is dooked templating. Let me repeat: doomed. Folly. |
Pekr: take any peice of template code that ends with curly braces unbalance, then insert a value through templating and then clsoe off the curly braces. | |
Now try assigning those opening and closing pieces to variables so as to generate code. If you try to use Rebol then there is an immediate problem because a great deal of real world code uses quoted strings. So now you need a literal string. But in Rebol that will be in curly braces. Sunk. Now you are escaping chartacters when you are tyring to generate code. No problem if code genrated by Rebol is consuked by Rebol. But that is not realistic. So now you are generating code with Rebol but then preporcessing hte code with Perl to strip out the escaping carets on the ^{ and ^} ??? | |
consumed by Rebol | |
Pekr 13-Aug-2009 [16596] | For me - REBOL is important, no need to adhere to JSON on my part. What I was trying to say is, that if we step aside because of every possible pseudo popular system, then we might miss some characters to use for quoting anyway :-) |
RobertS 13-Aug-2009 [16597x2] | JavaScript and ActionScript enjoy "psuedo-popularity" ?!? And white wine - say Chablis - with seafood ... pseudo popular as well? Someone who thinks the latter drinks too much beer or too much whiskey or no wine or what? |
R3 rejects comment { this is my test { } | |
Pekr 13-Aug-2009 [16599] | real world code ... then why using REBOL, if there is plenty of real world much better code much better languages around. I can accept anything, maybe the fix is easy, and then we should just submit a ticket, or - the worse case, it could affect REBOL internal parser, making it more complicated, slower. Dunno ... |
RobertS 13-Aug-2009 [16600] | Ok fine. But R3 also rejects comment {this is my silly test { } and whatever could explain that could not justify that in the real world. Back to Tcl we go. |
Pekr 13-Aug-2009 [16601x2] | surely it rejects it, as you did not escape the left curly brace, no? Well, I am really probably dumb, but how could you expect above code to work? You did NOT escape the code upon the REBOL's standard. Do you expect not escaping char used for string representation in other languages? |
So if I understand you correctly. REBOL is escaping/allowing escaping curly braces correctly via ^{, but the trouble is, that the curly brace is very often used in other languages for code sections, so it makes generating/mixing the code difficult? | |
RobertS 13-Aug-2009 [16603] | A scripting language on the server must tolerate literal strings. Python at google is one example. Rebol is not at google. Dave Hanson is. But ICON is not. So it is not some conspiracy. No one is out to subvert Rebol. JSON was an example. Examples abound. |
Pekr 13-Aug-2009 [16604] | how do you define literal string? |
RobertS 13-Aug-2009 [16605] | A nightmare if Rebol's output is to be another langauge's input. |
Pekr 13-Aug-2009 [16606x2] | our literal string is "content" {content}, and if you want to use quotes or curly braces, you have to escape them ... |
So what you are asking for is to use some really weird combination of chars, which could not by accident happen inside your string (unless someone is crazy), and use them as a string delimiter? | |
RobertS 13-Aug-2009 [16608x2] | A literal string has an indiated start and an indicated end and between you do not hiccup - how could we break comment on another forward curly brace? |
literal string delimiters. We are now UNICODE so we take our pick. | |
Pekr 13-Aug-2009 [16610] | Are we breaking comment on another forward curly brace? Works in R2, no? |
RobertS 13-Aug-2009 [16611x2] | Can we not use a word such as lit ? ( as I dare not suggest the word 'ls |
busted in R276 | |
Pekr 13-Aug-2009 [16613] | hmm, you are right with comment. So we basically can't comment larger section of code, by enclosing it in {} |
RobertS 13-Aug-2009 [16614x4] | Escaping characters in comments is pure Tcl to my mind. I love Tcl. But it should be used as Expect for what it is good at. Rebol is far more powerful and flexible and on one point exceedinly silly. |
The Tcl community has had some very high-level discussions among serious Tcl experts on their comment and brace balancing issues. The result is that their problems are there to stay. | |
I see it as a failure to evolve. They see the problem as an indication of their strength (their unique interpreter strategy ) | |
What about using a word which requires three paramaters the first and third of which must be those delimiters ( smart might be to have 3 sets of delimiters which need not even be paired - or to have what counts as a delimiter set for the user context with one pair of system defaults. | |
Pekr 13-Aug-2009 [16618] | couldn't we somehow use some rebolish combinations to identify a lit string? e.g. your's suggested ~{, or gab's #[{ }]# (more easily noticeable) |
RobertS 13-Aug-2009 [16619x2] | OOps, I left a right parenthesis stranded - luckily the text widget did not reject my input ... ;-) |
I thinkt he answer is to have Carl open a post on his R3 blog and get some comments - somefeedfack can get us to toptimal choices - maybe the anser is to have 3 pairs avaialbe - I don't know ( I'm just a Rebol user, not a Rebol guru ) Okay, Okay, I'm also a pain-in-the-neck ( I really do have cervical osteop. in real life - not usually funny, but that's life ;-) | |
Pekr 13-Aug-2009 [16621] | Who will ask Carl? Should I do it? I am rather good in bringing some topics on the table with Carl :-) OTOH BrianH might have even better channel to Carl ... |
older newer | first last |