Anonymous user
Sum and product of an array: Difference between revisions
Emacs Lisp: Rework solution
Not a robot (talk | contribs) (Add CLU) |
(Emacs Lisp: Rework solution) |
||
Line 938:
=={{header|Emacs Lisp}}==
<lang lisp>(
{{libheader|cl-lib}}
<lang lisp>(
(apply '+ array)▼
(apply '* array)</lang>▼
{{libheader|seq.el}}
▲<lang lisp>(setq array [1 2 3 4 5])
<lang lisp>(require 'seq)
(apply '* (append array nil))</lang>▼
(let ((array [1 2 3 4 5]))
(seq-reduce #'+ array 0)
=={{header|Erlang}}==
|