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: 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)
  • Re: Lisp article at IBM
    ... And one reason why Lisp isn't as popular as Java is because it is difficult ... with such ease and elegance. ... Likewise, while there are a few success stories based on lisp, these seem very ...
    (comp.lang.lisp)
  • Re: Is anything easier to do in java than in lisp?
    ... Is there any real difference between lisp ... debugging environments that allow introspection and Java debugging ... in java working with linked lists must be an awful pain. ...
    (comp.lang.java)