From: SourceForge.net <no...@so...> - 2011-01-25 20:07:22
|
Feature Requests item #3161730, was opened at 2011-01-19 09:24 Message generated for change (Comment added) made by quatras9 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3161730&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interpreter Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Allow ` accent as third quote type Initial Comment: I would like to see ooRexx support the ` accent character as a third quote delimiter. Justification: When ooRexx is used to generate code in other languages (or even to generate Rexx source) or if ooRexx is used as a macro language for an editor, it may have to deal with both single and double quotes as data. This is especially true if this is being done via a string being passed to a Rexx subcommand handler. Having accent as a quote type would help avoid quote-doubling, and would make the commands easier to read. Here is an example from ISPF, using this syntax: ADDRESS ISREDIT ` ISREDIT CHANGE T"isn't" C"don't" ` ---------------------------------------------------------------------- Comment By: Robert Hodge (quatras9) Date: 2011-01-25 15:07 Message: The objection to accent quotes on the grounds that "someone will want a 4th and 5th quote type" is short-sighted and misses several points. 1. First, there actually IS a character to use for a third quote type - the accent character to the left of the 1 key on US and many other keyboards. 2. What would such hypothetical 4th and 5th quotes be? Nearly all graphic characters that could be used in ooRexx are already in use. 3. It is true that some languages allow user-defined composite symbols for special-purpose quoting. The need for such special quoting must exist, or else no one would have implemented such things. However, my proposal here is nothing of the sort. It is unreasonable to object to the proposal at hand on the basis that "someday, someone" might ask for some new, additional feature - one I never mentioned myself - that would complicate the language; and, that because this hypothetical future proposal is "bad" that somehow it makes the current proposal "bad by association" or something. We are not speaking about the future. We are discussing the current proposal here, today. Let us stay focused on the matter at hand. No one is disputing that with tedious, cryptic string expressions and double-quoting, you can create any sort of string you wish. The point is, we shouldn't have to go through those contortions to do so. Because Rexx is commonly used not only as a macro and scripting language, but as a tool to generate source code in other languages (say, in C or C++), it becomes a great burden for users to have concatenation operatars and quote doubling as the only means of generating such code. Finally, it may be observed from an inspection of the source code, that very little code will be affected by this proposed change: a handful of lines in scanner.cpp to allow the accent quote, and a few entries to properly report unclosed accent-quoted strings in case of error. All told there couldn't be more than 2 dozen lines all told, so little you could knock it out in 20 minutes. ---------------------------------------------------------------------- Comment By: Jeremy C B Nicoll (jeremynicoll) Date: 2011-01-19 10:58 Message: I think this is a bad idea as it just increases the complexity of possible string literals. In no time at all someone will want a 4th and then a fifth quote character to cope with strings that contain the previous 3 or 4 quote characters as literals. I think when a string has a complicated content it's better to build it up from constituent parts - it certainly makes editing the contents of the parts easier. For example: command = "change" dblquot = '"' fromtxt = "T" || dblquot || "isn't" || dblquot intotxt = "C" || dblquot || "don't" || dblquot Although it wouldn;t work in this case (because of the intended difference in 'T' and 'C' operand flags), my own preference would normally be to avoid the complexities of having to quote strings which contain arbitrary content by using hex arguments: address isredit "change x'" || c2x(fromtxt) || "' x'" || c2x(intotxt) || "'" The same technique is a handy way to pass strings as one-word/token arguments between execs. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3161730&group_id=119701 |