Re: computing with characters



Torsten Bronger wrote:

However, join() is really bizarre. The list rather than the
separator should be the leading actor.

No, because join must work with _any sequence_, and there is no "sequence" type to put the join method on.
This semantic certainly sets python apart from many other languages.

>>> '-'.join(c for c in 'hello')
'h-e-l-l-o'
>>>
.



Relevant Pages

  • Re: A taxonomy of types
    ... Before a representation is practical I think we need a taxonomy (so we ... dynamic typing or type inference and most languages have rules ... Target domain of reference ... Sequence of component types and names ...
    (comp.lang.misc)
  • Re: The Evolution of the God Gene - NY Times
    ... Language has these four characteristics alphabet, grammar, meaning and ... between gene sequences and the sequence of the proteins, ... no grammar for genes - they do not have sequential structure or syntax, ... in natural languages according to Zipf's law. ...
    (talk.origins)
  • Re: The Evolution of the God Gene - NY Times
    ... have if at all only limited grammar ... between gene sequences and the sequence of the proteins, ... no grammar for genes - they do not have sequential structure or syntax, ... in natural languages according to Zipf's law. ...
    (talk.origins)
  • Re: mottainai
    ... but still a valid prediction. ... The assumption that sequence determines function but that function ... For example, considere cytochrome c. ... > languages are generally accepted by all linguists, ...
    (sci.lang.japan)
  • Re: Dredging up patterns
    ... > patterns in other languages are about working around language ... > limitations, then I should look at lisp patterns to see where the ... to have sequence operators take start and end keyword ...
    (comp.lang.lisp)