Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Dr. Arne Babenhauserheide
Walter Lewis writes: >> By the way, I'm rather confused as to why you deem this caching >> useful. A priori, I would expect a simple bytevector->pointer call >> would be just as fast as a to-pointer call. Do you somehow create >> lots of pointers to the contents of the same bytevector so that we

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Dr. Arne Babenhauserheide
Jean Abou Samra writes: > the macro. So I would expect this to create different identifiers for > different values of the-pair, just like it creates different identifiers > when instead of (car the-pair) I use fetch (also passed from outside). > > You're right, that's confusing. > > I don't h

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Jean Abou Samra
Le vendredi 11 août 2023 à 20:19 -0400, Walter Lewis a écrit : > To be honest I don't know enough about C to know the performance of  > bytevector->pointer, so I was assuming Chickadee's approach was done for > a reason. Below is the definition of bytevector->pointer in libguile/foreign.c: SCM

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Walter Lewis
Hi Jean, You could just turn that into a syntax-case macro, use gensym to generate the names, and insert them using with-syntax or quasisyntax. Yes, this is what I ended up doing before I saw your other reply. By the way, I'm rather confused as to why you deem this caching useful. A priori,

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Jean Abou Samra
Le vendredi 11 août 2023 à 10:33 +0200, Dr. Arne Babenhauserheide a écrit : > > Jean Abou Samra writes: > > > This is a known limitation in Guile. Please read > > https://www.gnu.org/software/guile/manual/html_node/Hygiene-and-the-Top_002dLevel.html > > I would not expect that effect from the d

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Jean Abou Samra
By the way, I'm rather confused as to why you deem this caching useful. A priori, I would expect a simple bytevector->pointer call would be just as fast as a to-pointer call. Do you somehow create lots of pointers to the contents of the same bytevector so that weak references they hold incur a noti

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Jean Abou Samra
Le vendredi 11 août 2023 à 18:50 -0400, Walter Lewis via General Guile related discussions a écrit : > Sorry I typed that code offhand and it had some mistakes; should be: > > ``` > (use-modules (srfi srfi-9) (system foreign)) > > (define-syntax define-ffi-wrapper >    (syntax-rules () > (

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Walter Lewis via General Guile related discussions
Sorry I typed that code offhand and it had some mistakes; should be: (use-modules (srfi srfi-9) (system foreign)) (define-syntax define-ffi-wrapper (syntax-rules () ((_ size name wrap unwrap predicate to-pointer from-pointer) (begin (define-record-type name

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Walter Lewis via General Guile related discussions
Hi Jean, On 8/11/23 4:00 AM, Jean Abou Samra wrote: This is a known limitation in Guile. Please read https://www.gnu.org/software/guile/manual/html_node/Hygiene-and-the-Top_002dLevel.html I expect that you would be able to fix your macro by using (define binding-you-want-to-report   (let ((pri

Re: [ANN] Guile-SMC 0.6.2 released

2023-08-11 Thread Artyom V. Poptsov
> Just out of interest: can you post a part of the code you really like? Well, as Guile-SMC is a tool for making tools, I think that Guile-INI could serve as a good example of what Guile-SMC can do. Here, you can see the finite state machine (FSM) description in PlantUML format: https://github.

Re: [ANN] Guile-SMC 0.6.2 released

2023-08-11 Thread Dr. Arne Babenhauserheide
Hello Artyom, "Artyom V. Poptsov" writes: > Hello Dr. Arne Babenhauserheide! > >> Very cool! > > Thanks. > >> Can Guile-SMC be used as a linter for plantuml? > > Yes, to some extent. The thing is that Guile-SMC currently supports > only a small subset of PlantUML format. Namely it can read Pla

Re: [ANN] Guile-SMC 0.6.2 released

2023-08-11 Thread Artyom V. Poptsov
Hello Dr. Arne Babenhauserheide! > Very cool! Thanks. > Can Guile-SMC be used as a linter for plantuml? Yes, to some extent. The thing is that Guile-SMC currently supports only a small subset of PlantUML format. Namely it can read PlantUML state diagrams (obviously that was first priority for

Re: [ANN] Guile-SMC 0.6.2 released

2023-08-11 Thread Dr. Arne Babenhauserheide
"Artyom V. Poptsov" writes: > I'm pleased to announce Guile State Machine Compiler (Guile-SMC), version > 0.6.2: > https://github.com/artyom-poptsov/guile-smc/releases/tag/v0.6.2 Very cool! > This release fixes some new-found bugs, namely in the state-machine > profiler. Also now it's possi

[ANN] Guile-SMC 0.6.2 released

2023-08-11 Thread Artyom V. Poptsov
Hello Guilers, I'm pleased to announce Guile State Machine Compiler (Guile-SMC), version 0.6.2: https://github.com/artyom-poptsov/guile-smc/releases/tag/v0.6.2 This release fixes some new-found bugs, namely in the state-machine profiler. Also now it's possible to specify "pre-action" and "post

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Dr. Arne Babenhauserheide
Jean Abou Samra writes: > This is a known limitation in Guile. Please read > https://www.gnu.org/software/guile/manual/html_node/Hygiene-and-the-Top_002dLevel.html I would not expect that effect from the description, because in (define-syntax unhygienic (syntax-rules () ((_ the-pair fetc

Re: Breaking hygiene with syntax-rules?

2023-08-11 Thread Jean Abou Samra
Walter, This is a known limitation in Guile. Please read https://www.gnu.org/software/guile/manual/html_node/Hygiene-and-the-Top_002dLevel.html I expect that you would be able to fix your macro by using (define binding-you-want-to-report   (let ((private-binding ...) ...)    expr...)) or (defi