LISTSERV mailing list manager LISTSERV 16.5

Help for CONLANG Archives


CONLANG Archives

CONLANG Archives


CONLANG@LISTSERV.BROWN.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

CONLANG Home

CONLANG Home

CONLANG  October 2006, Week 4

CONLANG October 2006, Week 4

Subject:

Re: OT: How to do a reverse word list in Perl

From:

Henrik Theiling <[log in to unmask]>

Reply-To:

Constructed Languages List <[log in to unmask]>

Date:

Fri, 27 Oct 2006 17:11:54 +0200

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (31 lines)

Hi!

Mark Reed writes:
> Well, you could do it that way in perl, too:
>
> map { reverse }
> sort
> map { reverse }
> <>;
>
> But I suspect keeping the original and reverting to it is more
> efficient than re-reversing it.
>...

Ah, is this about efficiency?  I don't really care unless it improves
the readability of the program or at least reduces the theoretical
computational complexity.  Readability and simplicity are much more
important to me than plain efficiency.

Unless it is really, really, really necessary to speed the program up
for the given purpose, I would think invoking a function twice as many
times does not justify writing complex indexing of temporary arrays,
for example.

So in Perl, I'd indeed prefer sort { reverse($a) cmp reverse($b) },
because it's much more readable (for me).

But this is just my personal idea of programming, of course.

**Henrik

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

Error during command authentication.

Error - unable to initiate communication with LISTSERV (errno=111). The server is probably not started.

ATOM RSS1 RSS2



LISTSERV.BROWN.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager