On Wed, Sep 25, 2013 at 6:37 PM, Glenn Fowler <[email protected]> wrote:
>
> On Wed, 25 Sep 2013 18:20:00 +0200 Irek Szczesniak wrote:
>> On Wed, Sep 25, 2013 at 6:05 PM, Glenn Fowler <[email protected]> wrote:
>> >
>> > On Wed, 25 Sep 2013 17:05:31 +0200 Irek Szczesniak wrote:
>> >> On Thu, Sep 19, 2013 at 3:46 PM, Cedric Blancher
>> >> <[email protected]> wrote:
>> >> > On 19 September 2013 10:49, Wendy Lin <[email protected]> wrote:
>> >> >> I have a request about LC_OPTIONS=unicode. I believe the name
>> >> >> 'unicode' is too generic
>> >> >
>> >> > +1
>> >> >
>> >> >> and should better describe what it does.
>> >> >> The first patch from Roland Mainz I saw used set -o convunicode, for
>> >> >> "convert to unicode". I think this, or 'convunicodeliterals', would be
>> >> >> a more fitting and descriptive name.
>> >> >
>> >> > "convunicodeliterals" is too long. Either "unicodeliterals" or
>> >> > "convunicode" would do it nicely :)
>> >
>> >> I'd prefer unicodeliterals, but would accept convunicode, too. Just
>> >> unicode is too generic. But I am also concerned about Olga's comment
>> >> about print -C to print compound variables using such literals. How do
>> >> we do that without tinkering with LC_OPTIONS each time? Add -U/+U as
>> >> requested by Olga?
>> >
>> > there are a few other ksh places where this may have an effect
>> > typeset -p and maybe a few other places where ksh offers a -p option
>> > to produce output that can be re-comsumed by the shell
>> > there's probably a connection with -x tracing too
>> >
>> > "unicodeliterals" is a fine solution and I'll put that in right now
>> > but I think it would be good to step back just a bit and list all
>> > of the places where "unicodeliterals" should take affect, at first
>> > *without proposing a solution*
>> >
>> > for ksh we already have
>> >
>> >         print -C
>> >         typeset -p
>> >         set -x
>> >
>> > any others, in or out of ksh?
>
>> print -v, and print %B for compound variables.
>
>> IMO a good point for -U/+U is: They are used in actual I/O to create
>> compound variable streams (one of the most undocumented and
>> undervalued feature in ksh93, which has greatly helped us with our
>> scripts. Just to praise it here because it solved the problems of
>> parsing, data version control (just add more fields if you need them
>> without breaking backwards compatibility) and performance (compared to
>> streaming XML)).
>
>> typeset -p is IMO just used internally and set -x is for diagnostics,
>> right? Does anyone every tried to parse that?
>
> dgk can correct me on this
> but the idea behind typeset -p is to be able to save portions of ksh context
> to be consumed later, possibly in a different { locale system platform }
> so the consumer for typeset -p is ksh so it better be as portable w.r.t 
> unicodeliterals

... and sometimes it needs to be as fast as hell which rules out the
use of \u[] in non-unicode locales. But IMO the *common* usage is
printf %q for string literals and print -C and print -v for compound
variable trees or arrays of compound variables. print -U/+U are about
making it easier to access. Non-common usage is covered by
LC_OPTIONS=unicodeliterals

Irek
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to