Re: Find an element in a functional set (guile-pfds)

2024-07-08 Thread Zelphir Kaltstahl
On 07.07.24 13:30, Zelphir Kaltstahl wrote: On 07.07.24 13:01, Maxime Devos wrote: >Maybe bbtree-fold can be used, but that would not "early exit" as soon as it has found an item, that satisfies some specified predicate. You can use escape continuations to do an early exit: ;; On success,

Re: Find an element in a functional set (guile-pfds)

2024-07-07 Thread Zelphir Kaltstahl
On 07.07.24 13:01, Maxime Devos wrote: >Maybe bbtree-fold can be used, but that would not "early exit" as soon as it has found an item, that satisfies some specified predicate. You can use escape continuations to do an early exit: ;; On success, return stuff-to-return. Otherwise, return the

RE: Find an element in a functional set (guile-pfds)

2024-07-07 Thread Maxime Devos via General Guile related discussions
>Maybe bbtree-fold can be used, but that would not "early exit" as soon as it has found an item, that satisfies some specified predicate. You can use escape continuations to do an early exit: ;; On success, return stuff-to-return. Otherwise, return the symbol ‘no-match’. (let/ec escape