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

2024-07-07 Thread Maxime Devos via General Guile related discussions
let/ec escape (bbtree-fold [...] [... when a match is found, use (escape stuff-to-return)] [...]) 'no-match) Best regards, Maxime Devos.

RE: How to have an optional dependency?

2024-06-24 Thread Maxime Devos via General Guile related discussions
t regards, Maxime Devos

RE: define-typed: checking values on proc entry and exit

2024-06-19 Thread Maxime Devos via General Guile related discussions
n another method of the generic). Best regards, Maxime Devos.

RE: Custom foreign types

2024-06-19 Thread Maxime Devos via General Guile related discussions
ugh I don’t know what this cleaner way is. You may want to look at the implementation for clarity (and if you find the answer, an addition to the manual would be appreciated). Best regards, Maxime Devos. (*) I think what it means is that as type you set (list this-field-type that-field-type ...)

RE: using guile like a awk filter in a C program.

2024-06-10 Thread Maxime Devos via General Guile related discussions
and then returns the Scheme representation (or an end-of-file marker). It can then be made available to Scheme with scm_c_define (I’m not sure about the name of the function, but surely there is a C function to define a Scheme ‘variable’ (in this case, constant)) etc. Best regards, Maxime Devos

RE: equality of syntax objects

2024-05-22 Thread Maxime Devos
(identifier? obj2) ;(syntax? obj2) > (free-identifier=? obj1 obj2))) So, instead of checking identifiers with free-identifier=?, instead try ‘syntax->datum’ to extract the name (with lexical information removed) + ‘eq?’ (to compare two symbols). Best regards, Maxime Devos

RE: cond clause does not allow definitions

2024-05-22 Thread Maxime Devos
would silently do the wrong thing (unless you enable warnings for shadowing, but you can do neat things with shadowing – you can write pure code in a somewhat imperative style (*)). Best regards, Maxime Devos (*) See, e.g., https://git.gnunet.org/gnunet-scheme.git/tree/gnu/gnunet/config/parse

RE: with-syntax return error in Guile, not in Kawa or Racket

2024-05-09 Thread Maxime Devos
eval-when. It’s mentioned somewhere in the documentation of macros, perhaps close to eval-when. Best regards, Maxime DEvos

RE: adding #' syntax and my cloned macro no more works like original....

2024-05-09 Thread Maxime Devos
The code you posted is too long – if you want me to have a look at it, minimize it first. Best regards, Maxime Devos

RE: with-syntax return error in Guile, not in Kawa or Racket

2024-05-06 Thread Maxime Devos
h the same as their quote/quasiquote/... counterparts. Hygiene is usually pretty simple – just don’t do sexp things (say, quasiquote), do syntax things (quasisyntax) instead, then typically things will go well. Best regards, Maxime Devos.

RE: Advice on ST-Object data-structure setup

2024-04-17 Thread Maxime Devos
lltalk, ;; and replace ‘define’ by what would be the equivalent in Smalltalk (define (st-vector-ref v n) ;; st-vector-like-actual-vector: field getter ;; vector-ref: standard Scheme procedure (vector-ref (st-vector-like-actual-vector v) n)) and the like. Best regards, Maxime Devos.

RE: Advice on ST-Object data-structure setup

2024-04-17 Thread Maxime Devos
LICENSE says ‘Copyright (c) 2016’, but some files date from 2024. It’s a bit inconsistent … Do you mean that changes >2016 are public domain, or not covered by BSD license, or the inconsistency is an oversight?

RE: Question about handling SIGINT properly in Guile

2024-04-14 Thread Maxime Devos
a scm_async_tick, so that shouldn’t matter?) • Better put a (call-with-blocked-asyncs ...) or whatever is the exact name around all the I/O unless you’re sure that the port I/O procedures can deal fine with the re-entrancy. I don’t expect any of these to solve the problem (except perhaps 3) but it’s something you could investigate. Best regards, Maxime Devos.

RE: Question about handling SIGINT properly in Guile

2024-04-14 Thread Maxime Devos
Sent from Mail for Windows From: Vijay Marupudi Sent: Saturday, 13 April 2024 22:24 To: Olivier Dion; guile-user@gnu.org Subject: Re: Question about handling SIGINT properly in Guile > So there is two things with signals. First, when a process get a signal > queued, the OS only deliver the

RE: using a module : rename a single definition

2024-03-19 Thread Maxime Devos
Yes, with ‘library’ or ‘define-library’ forms. (see https://www.gnu.org/software/guile/manual/html_node/R6RS-Libraries.html) (library (insert name here) (export [insert exports here]) (import (guile) ; standard imports (rename (ice-9 popen) (open-pipe pipe-open))) [insert

RE: Understanding `symbol??` macro from okmij.org

2024-03-13 Thread Maxime Devos
x to abracadabra, t to kt, f to kf). I think the first two cases are superfluous, but perhaps there is a performance advantage. (I’m wondering if this still works in the case (symbol? ...), because ... is special in syntax-rules) Best regards, Maxime Devos.

Re: Advice for importing things in a Guile module

2023-12-25 Thread Maxime Devos
, it wouldn't expect much trouble. Best regards, Maxime Devos. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: Screaming-Fist: a JIT framework for Guile

2023-12-04 Thread Maxime Devos
choose what, in their situation, are the appropriate semantics. If/when someone desired shorter names, there could be a (jit-define-alias * */wrap-around) or something like that for that? Best regards, Maxime Devos OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature

Re: How to globally replace core binding?

2023-11-27 Thread Maxime Devos
efault, but merely adding the _option_ to copy-on-write would be uncontroversial, I think. Best regards, MAxime Devos. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: How to globally replace core binding?

2023-11-27 Thread Maxime Devos
-term ‘trying things out’, doing set! is much more practical.) Best regards, Maxime Devos. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: Generating "independent" random numbers

2023-10-11 Thread Maxime Devos
Op 11-10-2023 om 01:04 schreef Keith Wright: Maxime Devos writes: Op 04-10-2023 om 18:14 schreef Keith Wright: From: Zelphir Kaltstahl my goal is normal distributed floats (leaving aside the finite nature of the computer and floats). The following is either provably correct up

Re: overloading an existing operator in Guile

2023-10-03 Thread Maxime Devos
of ‘addition’, and as an additional benefit, some other languages (^) use '++' to mean appending as well. (*) string-append, append, vector-append, ... (^) for example, Coq and Haskell Best regards, Maxime Devos. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature

Re: Generating "independent" random numbers

2023-10-03 Thread Maxime Devos
what you are interested in. (I probably didn't have to go in so much detail but whatever ...) Best regards, Maxime Devos. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: Ideas for making Guile easier to approach

2023-09-28 Thread Maxime Devos
Op 27-09-2023 om 21:29 schreef Christine Lemmer-Webber: Wisp I'd like to actually see Guile integrate Wisp as a core language and think about what it would be like to support it as a recommended alternate way of writing programs. I think with the new block-level highlighting that Arne

Re: Guile outside of Emacs + Geiser

2023-09-28 Thread Maxime Devos
n't it, but the why appears to be off-topic for this thread). Best regards, Maxime Devos OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: guile or scheme used to implement make or meson

2023-09-12 Thread Maxime Devos
/python-on-guile/ Best regards, Maxime Devos OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: readlink system calls

2023-08-24 Thread Maxime Devos
Op 22-08-2023 om 21:03 schreef Olivier Dion: On Tue, 22 Aug 2023, Christopher Baines wrote: When looking at strace for various Guile things, I'm seeing a lot of readlink system calls for directories in the load path, e.g. Is this not more a side effect of using Guix (the GNU store) than

Re: [ANN] Guile-PNG 0.7.1 released

2023-08-21 Thread Maxime Devos
Op 20-08-2023 om 15:03 schreef Artyom V. Poptsov: Hello Guilers, I'm pleased to announce Guile-PNG 0.7.1, Portable Network Graphics (PNG)[1] library for GNU Guile, implemented in pure scheme: https://github.com/artyom-poptsov/guile-png/releases/tag/v0.7.1 This release fixes some bugs,

Re: error Wrong type to apply: #

2023-08-09 Thread Maxime Devos
> [...] For reloadable modules, references to ‘top-level’ variables need to be done via a 'module-ref' equivalent instead of a direct (lexical) reference, but I think the compiler or expander could handle that without too much trouble (it does so already I think).

Re: error Wrong type to apply: #

2023-08-09 Thread Maxime Devos
Op 09-08-2023 om 01:00 schreef Jean Abou Samra: Le mardi 08 août 2023 à 21:38 +0200, Maxime Devos a écrit : As such, this not working on the top-level seems a bug to me -- after all, a module definition is conceptually just a big let: (if applicable) (let ()       (define

Re: error Wrong type to apply: #

2023-08-08 Thread Maxime Devos
Op 03-08-2023 om 11:58 schreef Jean Abou Samra: overload.scm must be before some definitions of scheme-infix.scm even if it is not used here, it is strange, i do not understand all but it compiles now A minimal reproducer for your problem is (define (foo)   (bar 'quux))

What's to be considered on-topic for Guile mailing lists? (Re: The message chain with an happy ending)

2023-07-05 Thread Maxime Devos
., __development__) -- it needs a name change, or some documentation in the manual. Best regards, Maxime Devos OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: The message chain with an happy ending

2023-07-05 Thread Maxime Devos
(In future responses, let's trim the CC:) OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: Problems compiling Guile for Solaris 11.4 SPARC

2023-05-29 Thread Maxime Devos
scm_write (key, port); scm_puts (", args: ", port); scm_write (args, port); . I don't know if scm_backtrace is functional in pre-boot, though. Best regards, Maxime Devos. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: Unable to import (ice-9 psyntax)

2023-02-16 Thread Maxime Devos
On 16-02-2023 12:18, Maxime Devos wrote: On 16-02-2023 00:48, Damien Mattei wrote: -rw-r--r--   1 root  wheel  516629 12 jan 08:12 psyntax-pp.go > [...]    * is /usr/local/lib/guile/3.0/ccache/ice-9/psyntax.go newer than      /usr/local/share/guile/3.0/ice-9/psyntax.scm go

Re: Unable to import (ice-9 psyntax)

2023-02-16 Thread Maxime Devos
On 15-02-2023 03:14, Robby Zambito wrote: Hello, For some reason I am having trouble importing the (ice-9 psyntax) module. [...] This is an undocumented module; you aren't supposed to import it directly. In fact, looking at the first few lines of ice-9/psyntax.scm, ice-9/psyntax.scm is

Re: Unable to import (ice-9 psyntax)

2023-02-16 Thread Maxime Devos
On 16-02-2023 00:48, Damien Mattei wrote: -rw-r--r--   1 root  wheel  516629 12 jan 08:12 psyntax-pp.go > [...]    * is /usr/local/lib/guile/3.0/ccache/ice-9/psyntax.go newer than      /usr/local/share/guile/3.0/ice-9/psyntax.scm going by mtime? -rw-r--r--   1 root  wheel  

Re: Unable to import (ice-9 psyntax)

2023-02-15 Thread Maxime Devos
On 15-02-2023 07:43, Damien Mattei wrote: same problem: (base) mattei@MacBook-Pro-Touch-Bar library-FunctProg % guile GNU Guile 3.0.8.99-f3ea8 Copyright (C) 1995-2022 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free

Re: Does declaration order matter in guile?

2023-02-13 Thread Maxime Devos
On 12-02-2023 19:46, wolf wrote: Also, I could not help to notice that when I use R6RS records it does work regardless of the order: (use-modules (rnrs records syntactic)) (define (x y) (display (q-foo y)) (newline)) (define-record-type q (fields

Re: Does declaration order matter in guile?

2023-02-13 Thread Maxime Devos
On 13-02-2023 09:05, Sascha Ziemann wrote: You also can not ask Scheme about macros, because macros are not first-class-citizens. > > > This might be interesting: > https://matt.might.net/articles/metacircular-evaluation-and-first-class-run-time-macros/ You actually can ask (Guile)Scheme

Re: How to initialize GNU guile in a C++ command line tool?

2023-02-09 Thread Maxime Devos
On 09-02-2023 11:43, Basile Starynkevitch wrote: /usr/bin/ld: /tmp/cc51HoPM.o: in function `do_evaluate_guile(char const*)': /home/basile/misc-basile/clever-framac.cc:501: undefined reference to `scm_init_eval' collect2: error: ld returned 1 exit status scm_init_eval is an internal thing:

Re: fibers,questions about thread id and mutation of vectors

2023-01-13 Thread Maxime Devos
for (i=start; i<=stop; i++) { /* i is private by default */ scm_init_guile(); scm_call_1( func , scm_from_int(i) ); IIUC, you are calling scm_init_guile once per index, whereas calling it once per thread would suffice. For better performance, I propose doing it once per thread.

Re: Exception with multiple irritants

2023-01-08 Thread Maxime Devos
On 25-11-2022 01:03, Zelphir Kaltstahl wrote: ice-9/boot-9.scm:1685:16: In procedure raise-exception: ERROR:   1.    2. : "contract violated"   3. : bla   4. : (> foo 10)   5. : (> 10 10) I don't understand this -- (> 10 10) is always false, no? I would interpret such an error message

Re: fibers,questions about thread id and mutation of vectors

2023-01-06 Thread Maxime Devos
no it returns something based on address: scheme@(guile-user)> (current-thread) $1 = # the good thing it is that it is different for each address, the bad is that i do not know how to extract it from the result and anyway i need a number : 0,1,2,3... ordered and being a partition to make

Re: fibers,questions about thread id and mutation of vectors

2023-01-06 Thread Maxime Devos
On 06-01-2023 11:20, Damien Mattei wrote: Hi, is fibers having a way to know the thread number the code is running? i, mean the equivalent of omp_get_thread_num(); in openMP. There's (current-thread), but that's just Guile; it's not Fibers-specific. It's also not a number. I don't know if

Re: guile-fibers timerfd_create bug (was: Re: [ANN] Guile-Parallel 1.0.0 released)

2023-01-03 Thread Maxime Devos
On 03-01-2023 23:38, Damien Mattei wrote: no i did not test fibers  ,just look at it, but perhaps it is necessary for parallel ? [...] IIUC, it's a bug report for Guile Parallel then? i saw the configure file (of parallel) claim about fibers? i will download fibers and test on Mac again

guile-fibers timerfd_create bug (was: Re: [ANN] Guile-Parallel 1.0.0 released)

2023-01-03 Thread Maxime Devos
On 03-01-2023 11:57, Damien Mattei wrote: on Mac os i have (only) one error: In procedure dlsym: Error resolving "timerfd_create": "dlsym(RTLD_DEFAULT, timerfd_create): symbol not found" Is this a bug report for Guile-Fibers? If so, could you provide basic information like which commit you

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-02 Thread Maxime Devos
On 02-01-2023 17:13, Greg Troxel wrote: O Olivier Dion via General Guile related discussions writes: I haven't use fibers a lot, but I think that if you ever need to handle asynchronous I/O, for now you should stick with fibers. Also, fibers was written by peoples that have a way better

Re: wayland client in Guile without libwayland-client

2022-11-18 Thread Maxime Devos
On 18-11-2022 17:54, Matt Wette wrote: cm-buf is a bytevector of control messages (`man cmsg`).  To deal with control messages I have generated these procedures:   (cmsg-list->bytevector cmsg-list) => bytevector   (bytevector->cmsg-list bytevector) => cmsg-list I have previously written

Re: Does the eval-when example work?

2022-10-20 Thread Maxime Devos
On 19-10-2022 22:32, Vivien Kraus wrote: Dear guile users, The manual, section 6.8.8, presents the eval-when form with an example: > [...] If so, this is not exactly what I am looking for. I am looking for a way to run the (date) form during the compilation phase, and save the date to the

Re: defining macros within eval

2022-10-19 Thread Maxime Devos
On 19-10-2022 10:42, Paul Jarc wrote: Maxime Devos wrote: For an example in the wild, see e.g. <https://git.gnunet.org/gnunet-scheme.git/tree/gnu/gnunet/message/protocols.scm>. Thanks (to Jean as well) for all the suggestions. Can you point me to an example of where include/sexp i

Re: defining macros within eval

2022-10-16 Thread Maxime Devos
On 16-10-2022 16:07, Jean Abou Samra wrote: Is there some way to make this work?  In my real code, the expression is read from a file, where it might be a macro definition or anything else, and it's evaluated in a different module from the current one. You cannot byte-compile code in 

Re: defining macros within eval

2022-10-16 Thread Maxime Devos
On 16-10-2022 11:39, Paul Jarc wrote: Hi. I'm updating some old code to work with newer versions of Guile. This example used to work with 1.8, but gives an error with 2.2 and later: (begin (eval '(define-syntax-rule (rule x) x) (current-module)) (display (rule "ok\n"))) ERROR: Wrong

Re: defining macros within eval

2022-10-16 Thread Maxime Devos
On 16-10-2022 11:39, Paul Jarc wrote: Hi. I'm updating some old code to work with newer versions of Guile. This example used to work with 1.8, but gives an error with 2.2 and later: (begin (eval '(define-syntax-rule (rule x) x) (current-module)) (display (rule "ok\n"))) ERROR: Wrong

Re: fibers doc: fix typo

2022-10-16 Thread Maxime Devos
> [...] Applied the two patches. Now in master. Greetings, Maxime. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: http-request bearer token syntax for Twitter v2 api

2022-10-13 Thread Maxime Devos
On 12-10-2022 12:30, Mortimer Cladwell wrote: Hi, Has anyone successfully submitted a bearer token to Twitter v2 api using http-request? What syntax did you use? Without success I have tried many permutations/splellings/capitalizations of: Note that Guile sometimes sends uncapitalised

Re: map-par slower than map

2022-10-12 Thread Maxime Devos
the 'map-par slower than map') and to change it to standard-ish Scheme instead of your Scheme+ variant. On Wed, Oct 12, 2022 at 8:45 PM Maxime Devos <mailto:maximede...@telenet.be>> wrote: [rest of copied previous message, without any comments] This is top-posting. For why not to

Re: map-par slower than map

2022-10-12 Thread Maxime Devos
On 12-10-2022 19:19, Damien Mattei wrote: Hello, all is in the title, i test on a approximately 3 element list , i got 9s with map and 3min 30s with par-map on exactly the same piece of code!? > [...] > translated from Scheme+ to Scheme: (define unified-minterms-set-1 (map

Re: Looking for graph library

2022-10-08 Thread Maxime Devos
On 08-10-2022 12:29, Dmitry Polyakov wrote: Hello! Can you recommend any library for working with graphs (I did not find it in srfi and mailing list). Almost what I need to have in graphviz bindings, but there are no predicate functions and the like. SRFI-234 is for linearizing a direct

python-on-guile fails to compile

2022-09-30 Thread Maxime Devos
I noticed python-on-guile fails to compile in Guix, so I tried updating it, but it still fails (somehow 'type' is #false?): Type is defined on line https://gitlab.com/python-on-guile/python-on-guile/-/blob/master/modules/oop/pf-objects.scm#L1530 as #f but set to something later in

Re: Error in error?

2022-09-22 Thread Maxime Devos
On 22-09-2022 01:17, sidhu1f wrote: You are both correct. My motivation was to use the assert macro from guile-libs (www.nongnu.org/guile-lib/doc/ref/debugging.assert/). Do you know that Guile already has an 'assert 'macro (see: (guile)rnrs base)? It is less capable though (no ?r-exp), so

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

2022-09-13 Thread Maxime Devos
On 13-09-2022 16:25, Damien Mattei wrote: do you have any examples of use? that illustrate the features ,just with the code it is not easy. "git grep -F let^" inside the repo. More specifically, parse-expandable from (gnu gnunet config parser), though there are other uses too.

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

2022-09-12 Thread Maxime Devos
On 12-09-2022 21:19, Linus Björnstam wrote: If you want a bit more advanced looping you could have a look at my goof-loop: https://git.sr.ht/~bjoli/goof-loop It currently does not support a break or continue clause, but adding one should not really be a problem. A good thing is that it

[ANN] Scheme-GNUnet 0.3 released

2022-09-06 Thread Maxime Devos
Version 0.3 of Scheme-GNUnet has been released. The main change since the 0.2 release, is some CADET support. There are also various small fixes and improvements. If you have any questions, please reply to guile-user@gnu.org. * What is Scheme-GNUnet? Scheme-GNUnet is a WIP (Guile) Scheme

Re: expression and definition context in Scheme

2022-08-31 Thread Maxime Devos
On 31-08-2022 09:01, Damien Mattei wrote: I always try to keep compatibility with RnRS and in fact except cond none of when, unless, cond, case, while, and do are in standart RnRS schem 'when', 'unless' and 'do' are actually RnRS, see (rnrs control). 'case' is also RnRS, see (rnrs base).

Re: The λ-cube

2022-08-30 Thread Maxime Devos
On 30-08-2022 03:03, Jean Abou Samra wrote: Retrying, it got all mangled up by automatic wrapping … It's mangled over here, perhaps you could sent it as an attachment? Greetings, Maxime OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description:

Re: expression and definition context in Scheme

2022-08-27 Thread Maxime Devos
On 27-08-2022 21:02, Damien Mattei wrote: in fact just allow 'define that act locally ,see my comment below I do not know what semantics you want. Also, even if (begin ...) and (let () ...) where unified, it would be a shame to lose the ability to only have some definitions

Re: expression and definition context in Scheme

2022-08-27 Thread Maxime Devos
On 27-08-2022 21:02, Damien Mattei wrote: I haven't read the RnRS closely, but I doubt that (some-procedure (define foo 0) (define bar 0)) ? i do not understand well the meaning Me neither, that's what I meant. You are proposing to unify expression context and definition

Re: expression and definition context in Scheme

2022-08-27 Thread Maxime Devos
On 27-08-2022 18:48, Damien Mattei wrote: My ideas is as it is so easy to cheat the compiler I don't think it's cheating or abusive. from seeing the expressio context why does the compiler restrict this? expression and defintion context, i'm not sure they are in scheme standarts, are they

Re: avoid character encoding/escaping in sxml->xml or htmlprag's sxml->html

2022-08-21 Thread Maxime Devos
On 21-08-2022 02:05, Aleix Conchillo Flaqué wrote: According to the spec, embedding inline content in the tag should conform to the language defined by the "type" attribute (defaults to javascript). So, I would expect you could put any string that conforms to JS.

Re: avoid character encoding/escaping in sxml->xml or htmlprag's sxml->html

The GuileScript looks nice, for interested readers, see On 20-08-2022 21:59, Aleix Conchillo Flaqué wrote: However, I'm not able to find a way to avoid character encoding/escaping and the generated code inside will always have "<", etc.

Re: Error in error?

On 19-08-2022 01:44, sidhu1f wrote: According to the guile (version 3.0.7) reference manual, (error "foo ~a" 'bar) should output "foo bar" but instead the output is "foo ~a bar". Am I missing something or is there a bug in error? You might need 'scm-error' instead: (scm-error 'misc-error

Re: Why does compile discard multiple values?

On 10-08-2022 15:01, Jean Abou Samra wrote: Hi, See: $ guile3.0 GNU Guile 3.0.7 Copyright (C) 1995-2021 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain

Re: Using Guile 2.2 modules with Guile 3

On 06-08-2022 17:31, Olivier Dion wrote: old Going by the package definition, guile-dbd-postgresql seems to make a Guile extension (C). There have been incompatible changes (both on the Guile code level, and presumably on the C level). As such, sounds risky to me. Also, for whatever reason,

Re: Using Guile 2.2 modules with Guile 3

On 06-08-2022 17:11, Olivier Dion via General Guile related discussions wrote: Hi, Say I want to use guile-dbi wich use Guile 2.2. Is there any danger for me to use it with Guile 3.0? I see that Guile will recompile the module because the already compiled one does not match, I guess. Other

Re: Contracts macro example

On 24-07-2022 03:21, Zelphir Kaltstahl wrote: (define-syntax require (identifier-syntax (syntax-error "'require' can only be used as part of a contract construct"))) Can you explain how it works? If you meant: how can identifier-syntax + syntax-error be used? -- I don't

Re: string is read-only

On 03-08-2022 12:55, Damien Mattei wrote: but no restrictions with lists in Guile: scheme@(guile-user)> (define lst '(1 2 3)) scheme@(guile-user)> (set-car! lst 7) scheme@(guile-user)> lst (7 2 3) Non-empty lists are pairs and the second part of the pair is another list -- in Guile, this is

Re: Fwd: string is read-only

On 03-08-2022 11:51, Damien Mattei wrote: ok and i suppose it is the standard, i have been confused by other schemes or racket where my code worked: It happens to work in Guile too, when you use the interpreter instead of the compiler: scheme@(guile-user)> (eval `(let ((a ,(string-copy

Re: string is read-only

On 03-08-2022 11:12, Damien Mattei wrote: scheme@(guile-user)> (define str2 "hello") scheme@(guile-user)> (string-set! str2 4 #\a) ice-9/boot-9.scm:1669:16: In procedure raise-exception: string is read-only: "hello" It's not -- the existence of read-only strings is implied by

Re: Macro for replacing a placeholder in an expression

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 same macro again and this way transform a whole tree of s-expressions? You can have recursive macros, see e.g. the let^ macro at

Re: Macro for replacing a placeholder in an expression

On 30-07-2022 22:44, Maxime Devos wrote: "All I want to do" is to replace some placeholder (in this case ) in an arbitrary form. No matter how that form looks or how deeply it is nested, if there are inside of it, I want to replace them. Is this impossible? Yes, see e.g. t

Re: Macro for replacing a placeholder in an expression

On 30-07-2022 17:42, Zelphir Kaltstahl wrote: [...] But now comes the problem: Since I want to replace all occurrences of for example and does not need to be defined, I think I must use define-syntax, to avoid Guile trying to evaluate the arguments to a function call. OK, so a macro I

Re: Macro for replacing a placeholder in an expression

On 28-07-2022 12:23, Zelphir Kaltstahl wrote: I'll need to look at this and learn about eval-when The eval-when is only required if the macro is 'run' when the module holding the macro is compiled (to avoid some compilation failures); often the eval-when can be dropped. Greetings, Maxime.

Re: Macro for replacing a placeholder in an expression

On 28-07-2022 10:39, Zelphir Kaltstahl wrote: I aimed to do everything with syntax-rules, as the simplest means, but when writing the code I have, I hit the snag, that one could not have multiple ellipses at the same level of nesting in the patterns. IIUC, you mean: (syntax-rules ()   ((foo

Re: Macro for replacing a placeholder in an expression

On 28-07-2022 01:57, Zelphir Kaltstahl wrote: scheme@(guile-user)> (define-syntax test   (syntax-rules (lambda)     [(_ (op args body* ...)) ((test op) (test args) (test body* ...))]     [(_ thing1 thing2 things* ...) ((test thing1) (test thing2 things* ...))]     [(_ (thing))

Re: Macro for replacing a placeholder in an expression

These macros all sound more complicated than necessary -- on the first one, I've sent you a message with sneek: ;; By: Maxime Devos ;; This does not recurse into #(...). ;; Also, such a construct does not nest well, you can't put a replace-result-placeholder inside a replace-result

Re: boiler plate class generation, writing fresh variables with macros

On 22-07-2022 11:43, Blake Shaw wrote: But if I try to use `slot-machine` inside a class definition i'm out of luck: (define-class () (slot-machine 'inner 'color "green")) => While compiling expression: Syntax error: socket:7257:0: source expression failed to match any pattern in form

Re: Contracts macro example

On 20-07-2022 10:39, Zelphir Kaltstahl wrote: It would also be nice to define a global 'require' and 'ensure' and '' somewhere (e.g.: (define-syntax require (identifier-syntax (syntax-error "'require' can only be used as part of a contract construct", that way, require / ensure / can be

Re: Contracts macro example

Zelphir Kaltstahl schreef op do 14-07-2022 om 23:55 [+]: >   (make-assertion-failure) >   (make-exception-with-message "assertion failed") >   (make-exception-with-irritants (quote (op args* ...)] Instead of a generic 'assertion failure', I believe a more specific

Re: mmap for guile

Ludovic Courtès schreef op ma 04-07-2022 om 12:09 [+0200]: > > Also, what if you mmap a region, use bytevector->pointer and pass > > it to > > some C thing, which saves the pointer somewhere where boehm-gc can > > find > > it and boehm-gc considers it to be live, is there something that > >

Re: mmap for guile

Ludovic Courtès schreef op ma 04-07-2022 om 12:09 [+0200]: > But we could provide special semantics: the bytevector would become > zero-length (possible, but weird, as Maxime points out), or it would > be turned into a /dev/zero mapping (weird as well). > > Thoughts? The former is weird and can

Re: mmap for guile

Ludovic Courtès schreef op ma 04-07-2022 om 12:09 [+0200]: > I don’t think the optimizer makes any such assumption, except for > literal bytevectors. It _does_ assume that bytevector lengths don't change: ,use (rnrs bytevectors) ,compile (bytevector-u8-ref some-variable 999) ;;; : warning:

Re: Wiki && Re: [feature request] merge sxml->html from (haunt html) into guile?

Maxime Devos schreef op di 28-06-2022 om 22:13 [+0200]: > Blake Shaw schreef op wo 29-06-2022 om 01:34 [+0700]: > > Which brings up another thing I've been considering working on > thats > > been discussed in the Guix community: the need for click-to-edit > > wiki, writte

Re: Wiki && Re: [feature request] merge sxml->html from (haunt html) into guile?

Blake Shaw schreef op wo 29-06-2022 om 01:34 [+0700]: > Which brings up another thing I've been considering working on thats > been discussed in the Guix community: the need for click-to-edit > wiki, written in Guile. [...] I don't think ‘written in Guile’ has been discussed? Also, I don't see

Re: 64-bit Guile on Windows

Thomas Thiriez via General Guile related discussions schreef op di 28- 06-2022 om 16:41 [+0200]: > Jean Abou Samra writes: > > > Le 27/06/2022 à 15:56, Thomas Thiriez via General Guile related > > discussions a écrit : > [...] > > > (* 999 999 999) -> -76738825 > [...] > > > > We had exactly

Re: 64-bit Guile on Windows

Jean Abou Samra schreef op di 28-06-2022 om 10:38 [+0200]: > We had exactly the same problem at LilyPond, and this was the fix: > > https://gitlab.com/lilypond/lilypond/-/blob/master/release/binaries/lib/dependencies.py#L721 > For security, shouldn't this check the hash of the downloaded

Re: mmap for guile

Some old mmap things that might be useful: * https://lists.nongnu.org/archive/html/guile-devel/2013-04/msg00235.html * https://lists.gnu.org/archive/html/bug-guile/2017-11/msg00033.html * https://lists.gnu.org/archive/html/guile-user/2006-11/msg00013.html +SCM_DEFINE (scm_mmap_search,

Re: mmap for guile

Matt Wette schreef op zo 26-06-2022 om 08:37 [-0700]: > scheme@(guile-user)> ,d mmap/search > - Scheme Procedure: mmap/search addr len [prot [flags [fd [offset >   See the unix man page for mmap.  Returns a bytevector.  Note that >   the region allocated will be searched by the garbage

Re: Curiosity: Microkernel implemented in Guile ?

Nala Ginrut schreef op do 23-06-2022 om 18:09 [+0800]: > Such a design, is actually the real GNU operating system described in > imagination. So the question should be: is there any attempt to write GNU > Hurd binding with Guile, and implement the multi server OS to complete GNU? > > I never

Re: Curiosity: Microkernel implemented in Guile ?

Matias Jose Seco Baccanelli schreef op do 23-06-2022 om 08:11 [+0200]: > Feels like a nice recipe for User Empowerment ! How does this empower users? Sure, if the user is a programmer they can modify their custom microkernel in Scheme, but then you have a very niche OS that practically no other

  1   2   >