[Info-vax] Quoting question
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Thu Jan 22 12:44:11 EST 2015
On 2015-01-22 06:45:23 +0000, Bart Zorn said:
> On Wednesday, January 21, 2015 at 5:32:23 PM UTC+1, JF Mezei wrote:
>> Say I have:
>>
>> $chocolate = "good"
>> $cherry = "red"
>> $flavour = "chocolate"
>>
>> is there a way to have
>>
>> $write sys$output "''flavour' is ?????????"
>>
>> come out as "chocolate is good" ?
>>
>> or would I have to do a substitution to a temporary variable first and
>> use that temp variable in the write sys$output command ?
>
> What is wrong with:
>
> $ write sys$output flavour, " is ", chocolate
>
> No quoting or substitution necessary.
Or going completely old school...
$ chocolate = "good"
$ flavour = "chocolate"
$ write sys$output f$fao("!AS is !AS",flavour,chocolate)
That's verified with:
$ show process/parse
....
Parse Style: Traditional
But as has been rather famously discussed over in Linux-land, using and
assuming case blindness for comparisons — whether it's within the file
system, or here at the DCL prompt — can lead to some nasty corner
cases. Case sensitivity is much simpler in terms of the
implementation, even if various humans would prefer to avoid that.
Nasty? With UTF-8, case conversions aren't uniformaly reversible;
converting a string to uppercase and then back to lowercase won't[1]
reliably get you back the same character string you started with,
either. The mappings aren't one-to-one. You'll usually end up
having to drag around the original and the mapped string.
########
[1] See the Unicode documentation for the default case algorithms
(section 3.13 in version 6.2 of the standard, page 115), and review the
associated documents such as the SpecialCasing-7.0.0.txt Unicode
character database document.
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list