develooper Front page | perl.fwp | Postings from January 2002

Re: solutions

Thread Previous | Thread Next
Peter Makholm
January 29, 2002 02:19
Re: solutions
Message ID:
Stephen Turner <> writes:

> Oh, also 7-9*index instead of 4*2**index loses a stroke and passes the test
> suite but doesn't solve the problem. (In a mail to Andrew, I called this my

You didn't try do something like '1<<index' which would save you 2
chars but then you had to do some shifting on the $. part too so might
sum up.

> Well, thank you. But I was just thinking I liked yours! The idea of writing
> a program to write a program to solve the problem somehow passed me by...

I have written a lot of scheme code including scheme-intepreters and
partial evaluators[0] to find code generating code quite

I'm raised with functional programming (scheme, SML and to a lesser
extend Haskell) which has a huge impact on my perl code. I prefer 

   map{...some code...}@list

over differetn kinds of while or for-loops. (map and other higher
order functions is heavily used in functional programming)

Når folk spørger mig, om jeg er nørd, bliver jeg altid ilde til mode
og svarer lidt undskyldende: "Nej, jeg bruger RedHat".
                                -- Allan Olesen på dk.edb.system.unix

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About