Re: Threading / Pipe Macro

2019-07-08 Thread Linus Björnstam
d. This does not matter in guile. -- Linus Björnstam On Mon, 8 Jul 2019, at 02:49, Erik Edrosa wrote: > On 7/7/19 6:42 AM, Zelphir Kaltstahl wrote: > > > > (1) Does something already exist? > > > > This project was posted not too long ago on this mailing list.

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-08 Thread Linus Björnstam
(-> (proc exp args ...) rest ...) ((-> exp proc rest ...) (-> (proc exp) rest ... I wrote this here in the mail without testing, so no guarantees that it would work. It is simple enough. I think it should work. -- Linus Björnstam On Tue, 9 Jul 2019, at 01:02, Chris Vine wrot

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-09 Thread Linus Björnstam
also (like the syntax rules macro i posted) also supports functions without parents as you can see in the first example. That's what I get for trying to.follow the discussion in an unthreaded mobile app :) [1]: https://bitbucket.org/bjoli/guile-threading-macros/src/default/ -- Linus

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-09 Thread Linus Björnstam
, I also provide a right-inserting macro as well: (~>> ...). The license is more or less "just don't remove this copyright notice from the source", so feel free :D -- Linus Björnstam On Tue, 9 Jul 2019, at 11:58, Chris Vine wrote: > On Tue, 09 Jul 2019 11:40:0

Re: Raising awareness about guile-pfds status

2019-07-15 Thread Linus Björnstam
don't know how using records compares to using cons pairs in guile, but there might be some speed gains. It also lacks a proper (as in fast) list->node because my 23 year old me didn't know how to implement it. It should be trivial. Fash and Fector are very fast. Andy likes spee

Re: Raising awareness about guile-pfds status

2019-07-16 Thread Linus Björnstam
On Mon, 15 Jul 2019, at 23:19, John Cowan wrote: > > > On Mon, Jul 15, 2019 at 4:50 PM Linus Björnstam > wrote: > > > If it is HAMTs or persistent vectors you want, I have a git repo of Andy's > > Fash and Fector (functional hashmaps and functional.vectors

Re: GNU Guile 2.9.6 Released [beta]

2019-12-06 Thread Linus Björnstam
might be that my ideas of JITs are wrong and that my.expectations are off! And why is mbrot soo much faster? Fun times to like programming in guile! Thanks Andy and everyone else involved! Linus Björnstam On Fri, 6 Dec 2019, at 14:14, Andy Wingo wrote: > We are pleased to announce GNU Guile

Re: Limiting parallelism using futures, parallel forms and fibers

2020-01-08 Thread Linus Björnstam
Hi! I don't have much more input than to say that futures use a built in thread pool that is limited to (current-processor-count) threads. That could maybe be modified using setaffinity ? Hope this helps. -- Linus Björnstam On Wed, 8 Jan 2020, at 08:56, Zelphir Kaltstahl wrote: &g

Re: SRFI-151 (Bitwise Operations) Implementation

2020-01-08 Thread Linus Björnstam
support. It passes all of John's tests. -- Linus Björnstam On Thu, 9 Jan 2020, at 05:28, Frank Terbeck wrote: > Hey Guilers! > > Since I got a project that uses (potentially large) integers to encode > bits in registers, I was looking at SRFIs that deal with that type

Re: SRFI-151 (Bitwise Operations) Implementation

2020-01-09 Thread Linus Björnstam
Your bitwise-nand etc takes more arguments than they have to. They are 2-argument procedures according to the spec, which gives you better performance than the apply-dance you are doing now. Maybe have a bitwise-nand and a bitwise-nand*? -- Linus Björnstam On Thu, 9 Jan 2020, at 10:10

Re: SRFI-151 (Bitwise Operations) Implementation

2020-01-09 Thread Linus Björnstam
om my module declaration. You can have it, no attribution required. Or you could just do the renaming in the #:re-export clause. -- Linus Björnstam On Thu, 9 Jan 2020, at 13:52, Frank Terbeck wrote: > Linus Björnstam wrote: > > Your bitwise-nand etc takes more arguments than they

Re: SRFI-151 (Bitwise Operations) Implementation

2020-01-09 Thread Linus Björnstam
Andy, Ludo, and Mark, but I feel safe saying that #:re-export is the safest bet. -- Linus Björnstam On Fri, 10 Jan 2020, at 06:15, Frank Terbeck wrote: > Hi, > > Linus Björnstam wrote: > > I just re-read my message and noticed it could come off as somewhat > > dismiss

Re: Pure (side-effect-free) calls into c/c++?

2020-01-11 Thread Linus Björnstam
lacks a fast path for single argument functions. You can disregard the repo license. Use that function is you like, if you like to. -- Linus Björnstam On Fri, 10 Jan 2020, at 23:36, Linas Vepstas wrote: > So, I've got lots of C code wrapped up in guile, and I'd like to declare &g

Re: Pure (side-effect-free) calls into c/c++?

2020-01-12 Thread Linus Björnstam
to specifically memoize the last n or the most common n arguments. -- Linus Björnstam On Sun, 12 Jan 2020, at 04:03, Christopher Lam wrote: > I can add a contribution! The good thing about memoize is it's simple > to create. You forgot a catch however: if the memoized return-val i

Announcing the first actually stable release of guile-for-loops

2020-01-23 Thread Linus Björnstam
ndom-identifier) '() (let ((a (car random-identifier))) (cons (* a a) (loop (cdr random-identifier)) Happy hacking Linus Björnstam

Re: Announcing the first actually stable release of guile-for-loops

2020-01-24 Thread Linus Björnstam
On Fri, 24 Jan 2020, at 09:16, Arne Babenhauserheide wrote: > Hi, > > Linus Björnstam writes: > > The syntax is more or less the same as racket's loops, and they are > > generally compatible. The code generated is for almost all cases as fast as > > hand-rolled

Re: Prevent inlining

2020-02-12 Thread Linus Björnstam
implicitly boxed. Slow unless guile is able to do unboxing... Ludo used the trick here: http://git.savannah.gnu.org/cgit/guile.git/commit/?id=bf1f5422bdb364667d6761dd73454558d6dbf895 -- Linus Björnstam On Wed, 12 Feb 2020, at 18:44, Stefan Israelsson Tampe wrote: > Hi all, > > Curr

Re: Prevent inlining

2020-02-13 Thread Linus Björnstam
Will it not inline "(not-inline x)" and then peval it to x? What are you trying to avoid? I am out on very deep water here, now I am just genuinely curious :D -- Linus Björnstam On Thu, 13 Feb 2020, at 08:36, Stefan Israelsson Tampe wrote: > No even if you have cross module inli

Re: Happy birthday, Guile!

2020-02-16 Thread Linus Björnstam
read function and returns a list of whatever the reader function returns until the port EOFs. less powerful than port-fold, but less fuss to use when you just want a list. I leave that as an exercise for the reader, though. -- Linus Björnstam On Sun, 16 Feb 2020, at 15:56, Ludovic Courtès wr

Re: Happy birthday, Guile! - grid printing

2020-02-17 Thread Linus Björnstam
Hi Zelphir! You should check out SRFI 166 or 159. It has columnar printing built in. I ported it to guile and one implementation is available in guix (under a non-standard module name iirc). https://srfi.schemers.org/srfi-166/srfi-166.html#Columnar-Formatting -- Linus Björnstam On Mon, 17

Re: Happy birthday, Guile! - grid printing

2020-02-17 Thread Linus Björnstam
will probably be slower though, since it uses call/cc to be able to handle streaming data. And it is user extensible which format strings never (?) are It is probably my all time favourite SRFI, up there with irregex. Both by the same author, no less :) -- Linus Björnstam On Mon, 17 Feb 2020

Re: Guile's time execution issues

2020-04-22 Thread Linus Björnstam
k string-append doesn't do that. Nice to see that my suggestions worked! -- Linus Björnstam On Wed, 22 Apr 2020, at 00:03, Aleix Conchillo Flaqué wrote: > Hi, > > I was trying to get some guile-json performance times loading large > JSON file. However, I'm getting increasi

Re: Guile's time execution issues

2020-05-04 Thread Linus Björnstam
On Mon, 4 May 2020, at 11:36, Ludovic Courtès wrote: > > One thing I found is that `match` is slow. The code looked nicer but had to > > change it back to lets and conds as the performance > > increase was ~2 seconds. > > Oh, in which case exactly? And are you sure your hand-written code is

Re: Guile's time execution issues

2020-05-04 Thread Linus Björnstam
not possible. Concerning "the macro writer's bill of rights" I could maybe think this it would be a rather nice thing to turn equal? to eqv? when one argument is a char literal :D -- Linus Björnstam On Mon, 4 May 2020, at 11:36, Ludovic Courtès wrote: > Hey! > >

Re: Guile's time execution issues

2020-05-04 Thread Linus Björnstam
the racket matcher does (among other things: some serious list matching reordering!). That is a daunting task though. -- Linus Björnstam On Mon, 4 May 2020, at 22:09, Ludovic Courtès wrote: > Hi, > > Linus Björnstam skribis: > > > On Mon, 4 May 2020, at 11:36, Ludovic Courtès w

Re: Functional hashtables

2020-05-05 Thread Linus Björnstam
I made a module out of Andy's dash (and added some comfort functions over fash-fold): https://hg.sr.ht/~bjoli/guile-fash/browse/fash.scm?rev=default What it lacks is a proper way to remove elements..I had a couple of stabs at it, but I fear I was too dumb. -- Linus Björnstam On Tue,

Re: Functional hashtables

2020-05-06 Thread Linus Björnstam
My code is still using mercurial. I will migrate it to git when I have the time. -- Linus Björnstam On Wed, 6 May 2020, at 13:24, Christopher Lemmer Webber wrote: > Linus Björnstam writes: > > > I made a module out of Andy's dash (and added some comfort functions &

Re: Guile's time execution issues

2020-05-08 Thread Linus Björnstam
guile optimisations. -- Linus Björnstam On Mon, 4 May 2020, at 22:50, Linus Björnstam wrote: > You didn't see my other reply. The matching code isn't suboptimal. The > equality predicate is The problem is that match compares using equal? > even for literal chars (where e

Re: SRFI-37 and short-name option with optional argument

2020-05-12 Thread Linus Björnstam
I Sony have an answer to your question, but using (ice-9 getopt-long)is usually the library guilers reach for unless they want to install third party libraries: https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong.html#getopt_002dlong -- Linus Björnstam On Tue, 12 May 2020

Re: guile-json 4.0.0 released

2020-05-17 Thread Linus Björnstam
to faster equality checking for suitable literals! Everybody wins! -- Linus Björnstam On Sun, 17 May 2020, at 08:42, Aleix Conchillo Flaqué wrote: > Hi! > > I'm super excited to announce guile-json 4.0.0. This new version comes with > a couple of small breaking changes and

Re: string-for-each vs. for-each+string->list performance

2020-06-07 Thread Linus Björnstam
optimization). -- Linus Björnstam On Sun, 7 Jun 2020, at 08:27, Aleix Conchillo Flaqué wrote: > Hi, > > in the latest guile-json, 4.1.0. I changed some code to use > for-each+string->list. The performance seemed nice and I released it. > > Christopher Lam pointed out that I could

Re: string-for-each vs. for-each+string->list performance

2020-06-07 Thread Linus Björnstam
ring-for-each is in the default environment, and is probably the same as the srfi-13 C implementation. -- Linus Björnstam On Sun, 7 Jun 2020, at 08:27, Aleix Conchillo Flaqué wrote: > Hi, > > in the latest guile-json, 4.1.0. I changed some code to use > for-each+string->list. The

Re: string-for-each vs. for-each+string->list performance

2020-06-12 Thread Linus Björnstam
since that would minimize the kind of performance problems discussed here. -- Linus Björnstam On Fri, 12 Jun 2020, at 22:13, Ludovic Courtès wrote: > Hi, > > Linus Björnstam skribis: > > > You can cut another 15-ish % from that loop by making an inline loop, btw &g

Programmatically expand macros

2020-06-16 Thread Linus Björnstam
syntax-local-value and doing it all myself, that is. Best regards Linus Björnstam

Re: guile-json 4.2.0 released

2020-07-02 Thread Linus Björnstam
With the current api, no. The code of guile-json could be used to implement srfi-180, but the current guile-json API could not efficiently implement srfi-180. I am not Aleix, but I helped making it faster for the 4.0 release. -- Linus Björnstam On Thu, 2 Jul 2020, at 16:55, Bill Markmann

Re: "Missing" libraries/concepts found in other languages/ecosystems?

2020-07-11 Thread Linus Björnstam
On Sat, 11 Jul 2020, at 02:34, Zelphir Kaltstahl wrote: > The comments about exception handling also reminded me of the following > blog post: > > https://blog.sulami.xyz/posts/common-lisp-restarts/ > > Pretty cool concept as well. > > If there anything like it in Guile or is something like it

Re: string-replace-substring is missing

2020-07-29 Thread Linus Björnstam
Iirc that was quite recently introduced. Unless you are using a recent guile (like 3.0.2 or 3.0.4) your guile installation does not have it. -- Linus Björnstam On Wed, 29 Jul 2020, at 14:01, mbcladw...@stihie.net wrote: > > Hi, > Reading > https://www.gnu.org/software/

Re: argument threading macros & combinators for guile

2020-08-06 Thread Linus Björnstam
lt;> and <...> used by my macros. Other than that, we have a srfi called chain that might be finalized soon. That must be srfi 190-something. -- Linus Björnstam On Thu, 6 Aug 2020, at 21:45, vapnik spaknik wrote: > Hi, > does anyone know of guile modules containing argum

Re: argument threading macros & combinators for guile

2020-08-06 Thread Linus Björnstam
I forgot to say, that is a trivial fix! Just import the bindings from srfi 26 and re-export them. This code can also be used to implement the new srfibchaij macro, although a syntax-case one would be about two billion times shorter (and faster). -- Linus Björnstam On Thu, 6 Aug 2020, at

Re: argument threading macros & combinators for guile

2020-08-08 Thread Linus Björnstam
settled on, taken from the cut macro in srfi-26 :) I will probably submit a patch to guile with srfi-197 whenever it gets finalized. I don't know if Ludo or Andy are interested in including it, but if not it can easily be made a package. -- Linus Björnstam On Fri, 7 Aug 2020, at 00:37,

Re: srfi-89 implementation for guile

2020-08-10 Thread Linus Björnstam
find in the guile sources. -- Linus Björnstam On Mon, 10 Aug 2020, at 22:07, Martin Becze wrote: > Hi Guilers, > I implemented srfi-89 (Optional positional and named parameters) > https://gitlab.com/mjbecze/guile-srfi-89/ > > It is hygienic and reuses guile's lambda*

Re: No Guile on Windows? (was: My Guile Hacker Handbook)

2020-08-13 Thread Linus Björnstam
TIL that guile 1.6 had 2.5% pascal code! -- Linus Björnstam On Thu, 13 Aug 2020, at 15:02, Pikachu Hy via General Guile related discussions wrote: > hi, > I build a msvc-version guile on Windows 10. > > https://github.com/PikachuHy/guile-1.6.7/releases/tag/v20200813 >

Re: list-set! Wrong type argument in position 1 (expecting mutable pair)

2020-08-26 Thread Linus Björnstam
Literals are immutable. (list-set! '(1 2 3) 1 0) -> error. (list-set! (list 1 2 3) 1 0) -> works -- Linus Björnstam On Wed, 26 Aug 2020, at 22:12, mbcladw...@stihie.net wrote: > > Hi, > One shortcoming I find working with Guile is the limited number of > exam

Re: What is the point of bytevectors?

2020-09-12 Thread Linus Björnstam
work with whatever C string representation your are using to guile. If your latin1 strings contain unicode data they are not latin1. -- Linus Björnstam On Sat, 12 Sep 2020, at 09:49, divoplade wrote: > Hello guile users, > > I am writing a library mixing some scheme code and C co

Re: Surprising behavior of eq?

2020-09-20 Thread Linus Björnstam
erted to cond for the benefit of 2.2, though, but it is still a nice thing to be able to rely on when writing macros. -- Linus Björnstam On Sun, 20 Sep 2020, at 19:05, John Cowan wrote: > On Sun, Sep 20, 2020 at 11:37 AM Zelphir Kaltstahl < > zelphirkaltst...@posteo.de> wrote: &

Re: goops speedups

2020-10-10 Thread Linus Björnstam
them would potentially be more efficient for the case when you want to go from 0..((find-dispatch len x) x). Guile lacks srfi-158, bit the reference implementation should run with no or very minor fixes. The coroutine generators should be done using delimited continuations though. --

Re: Namespace confusion/pollution in languages implemented via Guile's compile-tower

2020-11-08 Thread Linus Björnstam
The guile module used at the repl is indeed the guile-user module. I would look at how the elisp language is implemented. It switches the repl to the elisp module where no guile bindings are present. This is the same as doing ,m (module name) at the repl. -- Linus Björnstam On Sat, 7 Nov

Re: is there a way to serialize hash tables?

2020-12-26 Thread Linus Björnstam
could not repeat those numbers) an on files with many large strings in particular (10% in extreme cases). If that is interesting I could put it online somewhere. The functioning code is a derivate work of guile-json, so the GPL applies. -- Linus Björnstam On Sat, 26 Dec 2020, at 05:28, John

Re: is there a way to serialize hash tables?

2020-12-30 Thread Linus Björnstam
I have added it to my phone's dictionary, but for some reason it still autocorrects to Alex. Sorry about that. I know very well that it is Aleix. I remember I had the same problem last time. -- Linus Björnstam On Wed, 30 Dec 2020, at 00:18, Aleix Conchillo Flaqué wrote: > You almos

Re: Guile Potluck 2021

2021-02-27 Thread Linus Björnstam
! -- Linus Björnstam On Sat, 27 Feb 2021, at 10:39, Dr. Arne Babenhauserheide wrote: > I’d like to contribute a basic implementation of the Web of Trust in > Freenet that provides spam-detection without centralized control: > > https://hg.sr.ht/~arnebab/wispwot/browse/wispwot

Re: Guile Potluck 2021

2021-03-01 Thread Linus Björnstam
om: https://git.sr.ht/~bjoli/awesome-coroutine-generators I tried to extend it while sober. It didn't work, so be warned I guess. The code is somewhat a mess, but short enough to be understandable. Best regards Linus Björnstam On Thu, 18 Feb 2021, at 18:24, Mike Gran wrote: > Hello All- &

Naming help for a looping facility

2021-03-05 Thread Linus Björnstam
ported form does two related, but different things in different contexts? - (anding ...) makes sense, whereas (loop (... (:acc a (anding ...))) ...) does almost not at all. I somewhat prefer the last one, but it feels icky. So, scheme sages of guile-user, what do you say? Liebe Grüße Linus Björnstam

Re: Naming help for a looping facility

2021-03-06 Thread Linus Björnstam
On Sat, 6 Mar 2021, at 17:58, Zelphir Kaltstahl wrote: > Hello Linus! > > Not sure my idea for naming is any good: Perhaps you could use the word > "iteration" or "iter" in combination with something else. I don't think I will change the loop name. What I am interested in is the feedback for w

Re: Macro to prepend element to list

2021-03-20 Thread Linus Björnstam
Well, mutating like that is not very common, except for maybe with alists. In which situations are you mutating the list like that? Usually you would build a reverse list using a recursive function and an accumulator, which can be done without set! (which has a boxing overhead). -- Linus

Re: Macro to prepend element to list

2021-03-20 Thread Linus Björnstam
intain): (update! (select '(note-event 'artuculations)) (lambda (p) (cons (make-music ...) m))) This could be done with higher order functions and passing lambdas around without having to rely on macros... -- Linus Björnstam On Sat, 20 Mar 2021, at 18:05, Jean Abou Samra wrote

Re: Syntax-Case macro that selects the N-th element from a list

2021-04-05 Thread Linus Björnstam
ody) stuff is a syntax object. You could turn it into a list of syntax objects by doing #'(stuff ...). Then you can treat it as a regular list, and use quasisyntax to put it back into your output syntax. Writing this on my phone. Sorry for the brevity (and lack of code). -- Linus B

Re: Syntax-Case macro that selects the N-th element from a list

2021-04-05 Thread Linus Björnstam
That "syntax-rules" is of course syntax-case. Try writing it first with unhygienic macros and get that working before porting to syntax-case if you don't know the ins-and-outs of syntax-case. -- Linus Björnstam On Mon, 5 Apr 2021, at 14:21, Linus Björnstam wrote: &g

Re: Python-on-guile

2021-04-23 Thread Linus Björnstam
in a very nice direction for some time! -- Linus Björnstam On Fri, 23 Apr 2021, at 17:00, Mikael Djurfeldt wrote: > Hi, > > Yesterday, Andy committed new code to the compiler, some of which > concerned skipping some arity checking. > > Also, Stefan meanwhile committe

Re: GOOPS question

2021-04-30 Thread Linus Björnstam
This does not answer your question, but: There was just a SRFI released for growable vectors. I don't know about any interest to have it included in guile, but the reference implentation is probably trivially portable: https://srfi.schemers.org/srfi-214/srfi-214.html -- Linus Björ

Announcement: goof-loop 0.1

2021-05-11 Thread Linus Björnstam
#x27;(true false sant falskt wahr falsch vrai faux))) (scheme-value (in-cycle (in-list '(#t #f) (cons key scheme-value)) The loop expansion is usually as fast as a named let. You can find a lot more tofu in the readme and documentation. best regards Linus Björnstam

Re: Meaning of <=> in the context of procedures

2021-06-02 Thread Linus Björnstam
addition to) producing bad error messages. -- Linus Björnstam On Wed, 2 Jun 2021, at 16:06, Mortimer Cladwell wrote: > Hi, > What does <=> mean/do? > It can be found in guile-json in the (json record) module, line 33: > > 33 #:export (<=> define-json-mapping define

Re: Meaning of <=> in the context of procedures

2021-06-02 Thread Linus Björnstam
To reply to myself: it is an exported identifier that is used in a define-json-mapping. It is good form for macros to export all its auxiliary syntax. -- Linus Björnstam On Wed, 2 Jun 2021, at 18:12, Linus Björnstam wrote: > It is a trick to allow using the symbol '<=> as

Re: define anywhere

2021-06-05 Thread Linus Björnstam
I implemented this hack before guile 3 got defines in function bodies: https://hg.sr.ht/~bjoli/guile-define Even I guile 3 it allows a more liberal placement of define, but it won't work for things like bodies of imported macros (like match) -- Linus Björnstam On Sat, 5 Jun 2021, at

Re: define anywhere

2021-06-06 Thread Linus Björnstam
(+ a b c))) That should be an easy fix, again if there is any interest. -- Linus Björnstam On Sat, 5 Jun 2021, at 17:23, Linus Björnstam wrote: > I implemented this hack before guile 3 got defines in function bodies: > https://hg.sr.ht/~bjoli/guile-define > > Even I guile 3 it all

Re: define anywhere

2021-06-06 Thread Linus Björnstam
counterintuitive, the guile-proper version will do the right thing always. The syntactic differentiation mine does is just there for our feeble human minds, at least with regards to what guile-proper is doing. So TL/DR: guiles way is the correct way. -- Linus Björnstam On Sun, 6 Jun 2021

Re: define anywhere

2021-06-09 Thread Linus Björnstam
that makes everyone flinch about 105% of the time. -- Linus Björnstam On Wed, 9 Jun 2021, at 11:29, Damien Mattei wrote: > hello, i'm just answering now because my ten years old Mac book pro > definitely died sunday evening RIP > > i was trying to make macro that set! variable if

Re: delay and force

2021-06-09 Thread Linus Björnstam
o the user but want to make sure it is run at most one time. That is mostly how I have seen them used (and used them myself), at least. -- Linus Björnstam On Thu, 10 Jun 2021, at 07:08, Tim Meehan wrote: > Are there any good examples of "medium-sized" programs that use delay a

Re: guile style

2021-06-19 Thread Linus Björnstam
(quotient x 2 + a-list) will keep all even numbers and divide them by 2, and sum them. No intermediate collections build. They have higher overhead, but are usually faster already at 2 steps. Best regards Linus Björnstam

Re: strange error message in macro

2021-07-01 Thread Linus Björnstam
. -- Linus Björnstam On Thu, 1 Jul 2021, at 09:34, Damien Mattei wrote: > hello, > 'begin' complains of 'sequence of zero expressions in form (begin)' > in: > scheme@(guile-user)> ($ {x <- 7} {y <- 8} (+ x y)) > While compiling expression: > Syntax error: &

Re: Contract programming in Guile

2021-07-17 Thread Linus Björnstam
I wrote this a billion million years ago: https://hg.sr.ht/~bjoli/misc/browse/contract.scm?rev=tip Very basic. Contracts are just syntax and not first-class objects. -- Linus Björnstam On Sat, 17 Jul 2021, at 18:01, Olivier Dion via General Guile related discussions wrote: > Hi

Re: Contract programming in Guile

2021-07-18 Thread Linus Björnstam
I got a kid in addition to being naturally quite lazy, so that never happened. Linus Björnstam On Sun, 18 Jul 2021, at 18:50, Kjetil Matheussen wrote: > Linus Björnstam: > > > > I wrote this a billion million years ago: > > https://hg.sr.ht/~bjoli/misc/browse

Re: Syntax locations are ambiguous: can we track source 'offset' and 'length'?

2021-08-03 Thread Linus Björnstam
On Tue, 3 Aug 2021, at 00:50, Vivien Kraus via General Guile related discussions wrote: > Dear guilers, > > I’m playing with syntaxes as first-class objects, and I notice that the > syntax source location is ambiguous: > > (syntax-case > (call-with-input-string "(a\r b)" read-syntax) () >

Re: Scheme+

2021-12-20 Thread Linus Björnstam
you want to discuss some ideas or have any question we can take this off-list. Another thing would be to not use call/cc in the def form. Let/ec is a lot faster. -- Linus Björnstam On Mon, 20 Dec 2021, at 01:05, Damien Mattei wrote: > Hi, > I finished today the first version of

Re: Syntax objects as traditional pairs

2022-04-05 Thread Linus Björnstam
ent syntax->list that handles both cases and always returns a list. -- Linus Björnstam On Tue, 5 Apr 2022, at 01:00, Jean Abou Samra wrote: > Hi, > > I am lost as to when a syntax object whose syntax->datum is a pair > can be manipulated as a plain Scheme pair. For example

Re: Macro for replacing a placeholder in an expression

2022-08-05 Thread Linus Björnstam
algorithm, but without flattening. -- Linus Björnstam On Sat, 30 Jul 2022, at 23:13, Maxime Devos wrote: > On 30-07-2022 17:42, Zelphir Kaltstahl wrote: >> >> Does this mean, that recursive application of a macro inside a macro >> is impossible? To expand to subforms being the

Re: [ANN] Guile SRFI-146 0.1.0 released (purely functional data structures)

2022-08-13 Thread Linus Björnstam
utine-generator like this: https://git.sr.ht/~bjoli/awesome-coroutine-generators/tree/master/item/awesome-coroutine-generators/base.scm#L64 (where %tag and the generator-end object are replaced to make it compatible with srfi-128 and self-contained). -- Linus Björnstam On Mon, 8 Aug 2022, at

Re: Error in error?

2022-08-19 Thread Linus Björnstam
The error I find in the manual is: Scheme Procedure: error msg arg … Raise an error with key misc-error and a message constructed by displaying msg and writing arg Where are you getting your info? -- Linus Björnstam On Fri, 19 Aug 2022, at 01:44, sidhu1f wrote: > According

Re: expression and definition context in Scheme

2022-08-30 Thread Linus Björnstam
appendix and add some error reporting. The most difficult part is documenting it :) Andy have the idea hos blessing, and will mean guile gets define in expression context in when, unless, cond, case, while, and do as well as in derived forms. -- Linus Björnstam On Sat, 27 Aug 2022, at 18:48

Re: macro definition for continue and break

2022-09-12 Thread Linus Björnstam
higher order sequences, meaning it does not lead to the implicit boxing overhead of set!, which is a good idea in loops since that quickly adds up. Best regards Linus Björnstam On Sun, 4 Sep 2022, at 13:13, Jean Abou Samra wrote: > Hi, > > Adding back the list in CC. > > > Le

Re: Loop macros (was: Re: macro definition for continue and break)

2022-09-12 Thread Linus Björnstam
the internals. I have a couple of things I want to sort out, but the source code has started to scare me. -- Linus Björnstam On Mon, 12 Sep 2022, at 22:57, Maxime Devos wrote: > On 12-09-2022 21:19, Linus Björnstam wrote: >> If you want a bit more advanced looping you could have a l

Re: speed difference between Guile and Racket (and Python)

2022-11-08 Thread Linus Björnstam
lower than the same tail-recursive let loop. Also, for seems to expand to use call/cc instead of delimited continuations (which are supported in both guile and racket). The punishment in racket for call/cc is low, whereas it is high in guile. Best regards Linus Björnstam On Sun, 6 Nov 2022,

Re: letrec semantics

2022-12-01 Thread Linus Björnstam
ed in "fixing letrec(reloaded)". -- Linus Björnstam On Mon, 28 Nov 2022, at 09:33, Alexander Asteroth wrote: > Dear all, > > I know this topic has been discussed in the past. I found at least one > discussion in 2003 in guile-user@gnu.org which in the end referred to &g

Re: cond clause does not allow definitions

2024-05-24 Thread Linus Björnstam
I submitted a patch that expanded definition context to more places (cond, case, when, unless etc). I dont know what happened to that. I submitted it while moving and promptly forgot about it after some discussion. -- Linus Björnstam On Wed, 22 May 2024, at 21:26, Damien Mattei wrote: > sch

Re: warning: possibly unused local top-level variable `%foo?-procedure'

2024-06-06 Thread Linus Björnstam
Which version are you using? All my similar issues with srfi-9 went away last year when srfi things were marked maybe-unused. I don't have a computer this week so I cannot try your code. Sorry. -- Linus Björnstam On Wed, 5 Jun 2024, at 17:02, Tomas Volf wrote: > Hello, > >

Re: warning: possibly unused local top-level variable `%foo?-procedure'

2024-06-07 Thread Linus Björnstam
Thank you for making me realize I use guile-master... I am not really sure what that binding expands into, but it is reasonable to think it has no effect on performance -- Linus Björnstam On Fri, 7 Jun 2024, at 00:52, Tomas Volf wrote: > On 2024-06-06 22:02:50 +0200, Linus Björnstam wr

Re: Srfi-159/166 - monadic formatting for guile

2024-07-07 Thread Linus Björnstam
I had an implementation of 158 that was available in guix. However, bitbucket discontinued hg support and now the code is gone. It was trivial to port of the SRFI iirc. -- Linus Björnstam On Sat, 6 Jul 2024, at 15:55, Hans-Werner Roitzsch wrote: > On 06.07.24 02:00, Juliana Sims wr

Megacut - a clojure-like lambda shorthand

2019-03-26 Thread Linus Björnstam
x died recently, so I haven't been able to package it for guix. Best regards Linus Björnstam

SRFI-151 (bitfiddling) for guile

2019-04-06 Thread Linus Björnstam
#x27;t know about the tests, so probably them as well. The rest of the code is public domain (code by Olin Shivers edited by John Cowan, and code by me). The repo is here: https://bitbucket.org/bjoli/guile-srfi-151/ and the srfi document can be found here: https://srfi.schemers.org/srfi-151/sr

SRFI-128 for guile

2019-04-09 Thread Linus Björnstam
Regards Linus Björnstam

guile-threading-macros

2019-05-03 Thread Linus Björnstam
...)) define~> (define~> id ...) is the same as (define id (lambda~> ...)) https://bitbucket.org/bjoli/guile-threading-macros Best regards Linus Björnstam

Srfi-159/166 - monadic formatting for guile

2019-06-02 Thread Linus Björnstam
here is no time. -- Linus Björnstam

Re: Srfi-159/166 - monadic formatting for guile

2019-06-02 Thread Linus Björnstam
). This is quite some time into the future though. I need to try to make it faster (Alex mentions CL-style compiler macros and make some fast path for common cases). I don't know if that kind of hack is a show stopper for guile though. -- Linus Björnstam On Sun, 2 Jun 2019, at 22:42, Lu

Re: Srfi-159/166 - monadic formatting for guile

2019-06-14 Thread Linus Björnstam
circular list without any formatter is, like numbers, the same as whatever guile does. (show #t (circular-list 1 2 3)) displays the same as (display (circular-list 1 2 3)). Did I misunderstand your questions? -- Linus Björnstam On Wed, 12 Jun 2019, at 00:03, Mark H Weaver wrote: > Hi Lin

Re: Srfi-159/166 - monadic formatting for guile

2019-06-16 Thread Linus Björnstam
other way than black-on-white text on my 3.5" phone. Best regards Linus -- Linus Björnstam On Sun, 16 Jun 2019, at 08:37, Mark H Weaver wrote: > Hi Linus, > > Linus Björnstam writes: > > > I am not sure I understand what you mean, but i suspect it is already >

Re: Srfi-159/166 - monadic formatting for guile

2019-06-18 Thread Linus Björnstam
cause currently it is relying on call/cc and the overhead is quite noticeable. -- Linus Björnstam On Sun, 16 Jun 2019, at 21:35, Mark H Weaver wrote: > Hi John, > > John Cowan writes: > > > On Sun, Jun 16, 2019 at 2:47 AM Mark H Weaver wrote: > > > > > >> Ho

Re: global vars and #:declarative? (was [critical bug] The set! doesn't work in indirect reference)

2024-09-22 Thread Linus Björnstam
Den 2024-09-22 kl. 04:34, skrev Nala Ginrut: @Linus! I think it's similar to a getter/setter, but I think making it a function will be safer. I think a box is a good idea, since that is more or less what happens behind the scenes when you start mutating values outside contexts where autom

Re: global vars and #:declarative? (was [critical bug] The set! doesn't work in indirect reference)

2024-09-19 Thread Linus Björnstam
On Thu, 19 Sep 2024, at 17:33, Taylan Kammer wrote: > On > If I'm not mistaken: Using a local variable is often more efficient > than using a global variable, so if you needed to micro-optimize code > for maximum efficiency, you would want to do this > There's one potential issue with using pa