Another conversion to C or Java...



Hi all!

Excuse me, but I need another help translating a small piece of Lisp
code to C or Java:

(let ((prod (apply #'* probs)))
(/ prod (+ prod (apply #'* (mapcar #'(lambda (x)
(- 1 x))
probs)))))

Where "probs" is a list of the fifteen individual probabilities, i.e. a
list of 15 numbers between 0 and 1.

It's again from Paul Graham's spam algorithm...

Thanks in advance,
Marco Minerva, marco.minerva@xxxxxxxxxx

.



Relevant Pages

  • Re: Another conversion to C or Java...
    ... but I need another help translating a small piece of Lisp ... > code to C or Java: ... float truc(cons_t* probs){ ... is to develop with a dynamic system that has extreme late binding in ...
    (comp.lang.lisp)
  • Re: Learning Lisp the hard way
    ... Note I do not want to advocate Java over lisp, ... Unless you can use Windows to program AllegroCL (or also some *nixes, I forget which, where they have ported their IDE) because they do have a nice IDE closer to what you are used to in Java. ... Next on my list of disappointments is exception handling. ...
    (comp.lang.lisp)
  • Re: Learning Lisp the hard way
    ... Note I do not want to advocate Java over lisp, ... they have ported their IDE) because they do have a nice IDE closer to ... Next on my list of disappointments is exception handling. ...
    (comp.lang.lisp)
  • Re: Is anything easier to do in java than in lisp?
    ... And any experienced lisp ... in java generally you hardly ever use ... static String showInputDialog(Component parentComponent, ... which was about generic sequences (lists ...
    (comp.lang.java)
  • Re: Is anything easier to do in java than in lisp?
    ... And any experienced lisp ... in java generally you hardly ever use ... static String showInputDialog(Component parentComponent, ... which was about generic sequences (lists ...
    (comp.lang.lisp)