choice between quotes thoughts

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Aug 14 09:55:47 EDT 2001


09 Aug 2001 08:26:37 -0400, François Pinard <pinard at iro.umontreal.ca> pisze:

> Observing myself, I noticed that I use "..." for text meant to be displayed
> and read by a human, and '...' for more internal, programmatic strings.

Hey, get away from my mind! I wrote my post before I saw yours :-)

Let me add that I planned to extend this idea for another language
in one of two ways:

- Treat '' as a hint for the compiler that it should intern the string.
  AFAIK Python currently does this for strings consisting of alphanumeric
  characters.

- Have symbols (and constructors for algebraic types) separate from strings
  and denote them by ''. Or even with identifiers starting with a capital
  letter, i.e. True is defined nowhere and always denotes the same value.

Finally I used neither idea. Symbols are generated by a function and
bound to identifiers with normal scoping rules, and they don't have
intrinsic textual representation. '' is waiting for its meaning.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list