Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Clojure's core.logic it's also pretty succinct ;)

   (run* [mf ff ss hw ms sp]
     (fd/in mf ff ss hw ms sp (fd/interval 0 10))
     (fd/eq
       (= (+ (* mf 215) (* ff 275) (* ss 335)
             (* hw 355) (* ms 420) (* sp 580))
          1505)))
Also the post seems incorrect there seem to be two extra results that do not add up to $15.05?


I wondered how long it would be until a core.logic version appeared :)

I think the original post has one of the prices wrong.

BTW thanks for working on this stuff swannodette - I hope to look into core.logic in the not too distant future...

EDIT: Yes, his price for salad is 3.25 instead of 3.35




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: