hello,

doing maths with my kid, i just translated his spreadsheet with those
lines of haskell:

        rebonds height loss = height : rebonds (height - height * loss) loss
        main = print $ takeWhile (> 2) $ rebonds 116 0.6

then i wanted to make it as short as possible in perl6, i'm almost
there:

        (116, * * .6  ... * < 2 ).say

but the first $_ < 2 remains in the list. the only one alternative i see
is a gather/take loop but i really expect something shorter from perl6
:)

any idea ?

regards


-- 
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
"Don't believe everything you read on the Internet"
    -- Abraham Lincoln

Reply via email to