Re: finding common words

From: Hunter Johnson (hunter_at_hunterandlori.com)
Date: 02/25/04


Date: 25 Feb 2004 05:07:09 -0800

Uri Guttman <uri@stemsystems.com> wrote in message news:<x7d6842rkf.fsf@mail.sysarch.com>...
> >>>>> "HJ" == Hunter Johnson <hunter@hunterandlori.com> writes:
>
> HJ> Uri Guttman <uri@stemsystems.com> wrote in message news:<x74qth75vw.fsf@mail.sysarch.com>...
> >> now the docs will say there is no
> >> generated list in void context so that may be harder to argue. but i
> >> still say that map tells the reader a list is being made so look for
> >> it.
>
> HJ> If the docs say there is no list generated, how is map going to tell
> HJ> the reader that the docs are wrong?
>
> HJ> If a reader reads something extra into what's written (like "here
> HJ> comes a list" when none is coming), how is that more the writer's
> HJ> problem than the reader's? Either the writer can write it
> HJ> differently (using 'for' in this case) or the reader can read it
> HJ> differently. I don't see how the former is the only right answer.
>
> it is a semantic communication to the reader of the code. it is your
> (the coder's) responsibility to convey as much accurate information to
> the reader as possible. map in a void context is not as accurate as a
> for modifier even with the optimization.

Yes, it is because, as you say:

> sure the docs will say it won't generate a list

Of course, you then qualify that with:

> but its history has always been that way.

Historically, map wasn't even in perl, but people use it with its
current implementation anyway. That's all I'm suggesting will happen
now -- no list in void context means that programmers can (and should,
as they like) use it in void context, and readers will have to learn
that the language has changed, which it has.

Hunter

--
http://www.hunterandlori.com


Relevant Pages

  • Re: finding common words
    ... i didn't like the semantic problem of throwing away the list ... >> that map is supposed to make. ... >> generated list in void context so that may be harder to argue. ... HJ> the reader that the docs are wrong? ...
    (comp.lang.perl.misc)
  • Re: finding common words
    ... > i was never really upset about the efficiency issue which has been ... i didn't like the semantic problem of throwing away the list ... > that map is supposed to make. ... the reader that the docs are wrong? ...
    (comp.lang.perl.misc)
  • Re: Map Endpapers!
    ... How significant are map endpapers, ... I find it interesting when a publisher puts different map ... I think that much of the time when a dealer mentions "map endpapers", he/she is trying to make sure the reader understands which edition is on offer. ...
    (rec.collecting.books)
  • Re: converting a sed / grep / awk / . . . bash pipe line into python
    ... use of map() and just write: ... The potential unpack and conversion errors exist ... by the shared error handling. ... a reader of the code to follow what it's doing. ...
    (comp.lang.python)
  • Re: Whos on first?
    ... of it in my own reading. ... What are some examples of good books ... The reader, who is usually more sensible than they are, understands what's going on because they've been given accurate information, even if the narrator is not drawing the right conclusions from it. ...
    (rec.arts.sf.written)