[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Downcase of a symbol
From: |
David Kastrup |
Subject: |
Re: Downcase of a symbol |
Date: |
Sat, 13 Aug 2016 17:04:51 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Urs Liska <address@hidden> writes:
> Am 13.08.2016 um 08:10 schrieb David Kastrup:
>> Urs Liska <address@hidden> writes:
>>
>>> I have written a function to return the lowercase version of a symbol
>>> for use in my library as
>>>
>>> % Return the lowercase version of a symbol
>>> #(define (symbol->lowercase sym)
>>> (string->symbol
>>> (string-downcase
>>> (symbol->string sym))))
>>>
>>> Just a small question: this seems so general
>> Why? What would that be useful for? Normal convention for symbols is
>> already lowercase.
>
> I accept package/module names as a symbol-list path, and users are
> allowed to write them using "display" names, like
>
> \loadModule scholarLY.annotate
>
> Internally I'm converting them to lowercase to prevent ambiguity, so
> input is a symbol but with arbitrary case. Having a list of strings
> would be much less convenient to use.
Case insensitivity is almost never a good idea. It leads to stuff that
sometimes works and sometimes fails under mysterious circumstances.
For example, you are aware that in a Turkish locale, I downcases to ı
instead of i , and i uppercases to İ instead of I ?
And if you do search-and-replace operations (like convert-ly does) for
code changes, you'll only catch some parts.
--
David Kastrup