You're right, I was wrong :)

John

On Tue, Oct 9, 2018 at 3:07 PM <[email protected]> wrote:

> On Tue, 09 Oct 2018 19:31 +0200, Alexander Burger wrote:
> > On Tue, Oct 09, 2018 at 01:21:07PM -0400, John Duncan wrote:
> > > Yes, you couldn't reuse the same initial value for a data structure
> like
> > > you would in scheme
> >
> > How do you mean that? As I said, this code is completely free of
> destructive
> > side effects. You can use and reuse any initial value.
>
> Indeed.
>
> $ pil
> (de foldl (F I . @)
>    (pass
>       mapc
>       '(@
>          (setq I (apply F (conc (rest) (cons I)))) ) ) )
> -> foldl
> : (setq I 0)
> -> 0
> : (foldl '+ 0 (1 2 3 4))
> -> 10
> : I
> -> 0
>
> "Inside" `foldl` there is some "Hulk smash!"ing going on, but not
> outside.  `foldl` owns `I` and smashes on it with impunity; that's not a
> problem.
>
> --
> UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
>


-- 
John Duncan

Reply via email to