> > > It is quite inefficient, as it needs to build a new list of > all
> > > arguments on
> > > each call:
> > Well i see ways how it could be speed up it up in assembly but only by
> > adding
> > lots of complexity.
> Yes. I'm afraid it needs very much complexity!
> Interestingly, 'foldr' wo
On Tue, Oct 09, 2018 at 09:57:48PM +0200, Johann-Tobias Schäg wrote:
> > It is quite inefficient, as it needs to build a new list of > all arguments
> > on
> > each call:
> Well i see ways how it could be speed up it up in assembly but only by adding
> lots of complexity.
Yes. I'm afraid it needs
Yes, it makes more sense in reducing type languages like scheme and
Haskell, where its operating model is identical to the recursion that would
normally be implemented.
On Tue, Oct 9, 2018, 4:03 PM Johann-Tobias Schäg
wrote:
>
> > It is quite inefficient, as it needs to build a new list of > all
> It is quite inefficient, as it needs to build a new list of > all arguments on
> each call:
Well i see ways how it could be speed up it up in assembly but only by adding
lots of complexity.
(conc (rest) (cons I))
> and it has no advantage over a direct inline
> expression of what it does I
On Tue, Oct 09, 2018 at 09:19:29PM +0200, Jakob Eriksson wrote:
> Add foldl to standard library?
I would not recommend that.
It is quite inefficient, as it needs to build a new list of all arguments on
each call:
(conc (rest) (cons I))
and it has no advantage over a direct inline expression
You're right, I was wrong :)
John
On Tue, Oct 9, 2018 at 3:07 PM 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
Add foldl to standard library?
> 9 okt. 2018 kl. 20:59 skrev r...@tamos.net:
>
>> 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
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 destruct
On Tue, 09 Oct 2018 14:24 +, Mike wrote:
> My demo code to mimic racket's reference:
> https://bitbucket.org/mihailp/tankfeeder/src/default/foldl.l
Excellent! I'm stealing this! :) Thanks!
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
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.
But you
Yes, you couldn't reuse the same initial value for a data structure like
you would in scheme
On Tue, Oct 9, 2018, 12:15 PM Alexander Burger wrote:
> > On Tue, Oct 9, 2018, 10:30 AM Mike wrote:
> >
> > > hi all,
> > >
> > > My demo code to mimic racket's reference:
> > > https://bitbucket.org/mi
> On Tue, Oct 9, 2018, 10:30 AM Mike wrote:
>
> > hi all,
> >
> > My demo code to mimic racket's reference:
> > https://bitbucket.org/mihailp/tankfeeder/src/default/foldl.l
Perfect!
On Tue, Oct 09, 2018 at 10:57:43AM -0400, John Duncan wrote:
> Isn't it destructive to I?
You mean the line (se
Isn't it destructive to I?
On Tue, Oct 9, 2018, 10:30 AM Mike wrote:
> hi all,
>
> My demo code to mimic racket's reference:
> https://bitbucket.org/mihailp/tankfeeder/src/default/foldl.l
>
> (mike)
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>
hi all,
My demo code to mimic racket's reference:
https://bitbucket.org/mihailp/tankfeeder/src/default/foldl.l
(mike)
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Thanks for all the answers. The reason I asked was, I’ve been playing a bit
with Racket doing some “heavy” floating-point math, and I got quite used to the
‘foldl’ function. Then I couldn’t remember having seen that function or
anything quite similar i PicoLisp.
/Jon
> On 9. Oct, 2018, at 04:5
On Mon, 08 Oct 2018 19:15 +, Jon Kleiser wrote:
> Hi,
>
> Is there a PicoLisp function similar to the Scheme 'foldl'?
Hi Jon!
You've probably already gone there, but FWIW this is what I have used in the
past.
(de foldl (Op Init Xs)
(let (Acc Init)
(for X Xs (setq Acc (Op Acc X)))
Yeah, all foldl does in scheme or haskell is encapsulate this pattern. In
haskell and scheme they like it for being able to compose functions. For
example:
sum = foldl + 0
Perhaps not as useful in Picolisp, which is not exactly a functional
language in the same sense.
On Mon, Oct 8, 2018 at 5:13
On Mon, Oct 08, 2018 at 08:50:09PM +, Mike wrote:
> >
> > Is there a PicoLisp function similar to the Scheme 'foldl'?
> ...
> There is no foldl. This is too general and not required in core.
> What you intent to do ?
>
> Truly, I cant imagine when somebody needs it, because
>
> (foldl cons
>
> Is there a PicoLisp function similar to the Scheme 'foldl'?
>
> See description here:
>
> https://docs.racket-lang.org/reference/pairs.html?q=foldl#%28def._%28%28lib._racket%2Fprivate%2Flist
> .rkt%29._foldl%29%29
>
There is no foldl. This is too general and not required in core.
What you
Hi,
Is there a PicoLisp function similar to the Scheme 'foldl'?
See description here:
https://docs.racket-lang.org/reference/pairs.html?q=foldl#%28def._%28%28lib._racket%2Fprivate%2Flist..rkt%29._foldl%29%29
?/Jon
20 matches
Mail list logo