Re: G-Golf using GtkBuilder or not

2025-05-29 Thread Zelphir Kaltstahl
Hi David! On 28.05.25 20:36, David Pirotte wrote: I wonder why that is though. I imagine (I don't know that for sure at all, so some Dunning-Kruger chance here) that internally Gtk probably uses the same machinery ... Not at all. A template is installed at (GObject) class initialization time, a

Re: G-Golf usage questions, g-object-unref and others

2025-05-28 Thread Zelphir Kaltstahl
On 28.05.25 15:39, webmas...@free-comp-shop.com wrote: Zelphir Kaltstahl writes: Ah OK! I thought it might be perceived as annoying, if I send 3 separate ones, but it makes sense for the purpose of focused discussion. I'll branch out from here using separate replies. Actually, that c

Re: G-Golf general questions

2025-05-28 Thread Zelphir Kaltstahl
On 28.05.25 00:25, David Pirotte wrote: Hello Zelphir, [...] I am slowly figuring things out with G-Golf and trying to build my own examples for how to do things with it. (repo: https://codeberg.org/ZelphirKaltstahl/guilt-gtk-g-golf-examples, or most recent branch: https://codeberg.org/ZelphirKa

Re: G-Golf using GtkBuilder or not

2025-05-28 Thread Zelphir Kaltstahl
Hi David, On 28.05.25 00:25, David Pirotte wrote: Hello Zelphir, [...] ;; A UI XML string can be processed by a GtkBuilder. I have little experience using gtk builder, upstream developers convinced me to switch to (always) use templates. I wonder why that is though. I imagine (I don't

Re: G-Golf usage questions, g-object-unref and others

2025-05-28 Thread Zelphir Kaltstahl
Hi David! On 28.05.25 00:25, David Pirotte wrote: Hello Zelphir, As an aside note, this email is far too long and mixes far too many subjects and questions 'at the same time', please in the future, make one email per question, keep it short and precise as possibl

G-Golf usage questions, g-object-unref and others

2025-05-27 Thread Zelphir Kaltstahl
Hello Guile/G-Golf users, I am slowly figuring things out with G-Golf and trying to build my own examples for how to do things with it. (repo: https://codeberg.org/ZelphirKaltstahl/guilt-gtk-g-golf-examples, or most recent branch: https://codeberg.org/ZelphirKaltstahl/guilt-gtk-g-golf-example

Re: G-Golf - How to use or import G-types like G_TYPE_STRING and similar?

2025-05-08 Thread Zelphir Kaltstahl
Hello David! On 06.05.25 05:27, David Pirotte wrote: Hi Zelphir, I am trying to use G-Golf to create a tree view (the thing that looks like a table) and for that purpose to create a GtkListStore instance. Do not use GtkTreView, deprecated in 4.10 and will be removed from Gtk-5. Instead, caref

G-Golf - How to use or import G-types like G_TYPE_STRING and similar?

2025-05-05 Thread Zelphir Kaltstahl
Hello Guile Users! I am trying to use G-Golf to create a tree view (the thing that looks like a table) and for that purpose to create a GtkListStore instance. The GTK4 docs at https://docs.gtk.org/gtk4/section-tree-widget.html#creating-a-model tell me, that I need to create the store. A simp

Color theme from gnu.org G-Golf index page

2025-05-05 Thread Zelphir Kaltstahl
Hello Guile users! I like the color theme of the code on https://www.gnu.org/software/g-golf/index.html and I am wondering, whether this theme has any name. Perhaps I can find it for my Emacs ... Does anyone know? I checked the CSS filename, but it is just "base.css" and does not give a name

Re: G-Golf code example links broken

2025-05-05 Thread Zelphir Kaltstahl
On 05.05.25 22:09, Zelphir Kaltstahl wrote: Hi! I noticed, that some example code links from https://www.gnu.org/software/g-golf/learn.html are broken, or rather lead to "502 Bad Gateway" error pages. For example the http://git.savannah.gnu.org/cgit/g-golf.git/tree/examples/gtk-4

G-Golf code example links broken

2025-05-05 Thread Zelphir Kaltstahl
Hi! I noticed, that some example code links from https://www.gnu.org/software/g-golf/learn.html are broken, or rather lead to "502 Bad Gateway" error pages. For example the http://git.savannah.gnu.org/cgit/g-golf.git/tree/examples/gtk-4/clipboard clipboard example. Best regards, Zelphir --

Re: First example of g-golf (hello world) not working

2025-05-05 Thread Zelphir Kaltstahl
On 16.04.25 13:11, Zelphir Kaltstahl wrote: On 14.04.25 22:26, pelzflorian (Florian Pelz) wrote: Hello Zelphir. Zelphir Kaltstahl writes: I have many questions now. (1) So, if I understand correctly G-Golf applications can only be run with the help of Guix tooling like `wrap-program`? Unless

Re: First example of g-golf (hello world) not working

2025-04-15 Thread Zelphir Kaltstahl
On 14.04.25 22:26, pelzflorian (Florian Pelz) wrote: Hello Zelphir. Zelphir Kaltstahl writes: I have many questions now. (1) So, if I understand correctly G-Golf applications can only be run with the help of Guix tooling like `wrap-program`? Unless I somehow set all the environment variables

Re: First example of g-golf (hello world) not working

2025-04-13 Thread Zelphir Kaltstahl
On 13.04.25 21:24, pelzflorian (Florian Pelz) wrote: Sorry I cannot respond quickly. I will try Zelphir’s Makefile later, but what I meant by wrapping is that $(guix build g-golf-gtk-4-examples)/share/doc/g-golf/examples/gtk-4/hello-world is a bash wrapper script that contains: #!/gnu/store/k

Re: First example of g-golf (hello world) not working

2025-04-12 Thread Zelphir Kaltstahl
On 13.04.25 05:56, David Pirotte wrote: Hello Zelphir, I guess --no-grafts is not sufficient, and I need to use it, and additionally install one of the two packages you mentioned. Merely adding --no-grafts still results in the error: I believe your guix shell command is incomplete. Florian, c

Re: First example of g-golf (hello world) not working

2025-04-12 Thread Zelphir Kaltstahl
Hello Florian, On 12.04.25 15:36, pelzflorian (Florian Pelz) wrote: David’s explanation is correct as far as I understand and should help (I hope? it does work for me on Sway) except one little detail: David Pirotte writes: You can't run the upstream version of the g-golf distributed examples

Re: First example of g-golf (hello world) not working

2025-04-12 Thread Zelphir Kaltstahl
Hello David, On 12.04.25 05:07, David Pirotte wrote: Hello Zelphir, Yesterday I decided to give g-golf a try. Unfortunately I did not get very far at all. I tried running the hello world example, and it already crashed: You can't run the upstream version of the g-golf distributed examples in

First example of g-golf (hello world) not working

2025-04-11 Thread Zelphir Kaltstahl
Hello Guile Users! Yesterday I decided to give g-golf a try. Unfortunately I did not get very far at all. I tried running the hello world example, and it already crashed: main.scm Copyright (C) 2022 - 2023 Free Software Foundation, Inc. This file is part of GNU G-G

Re: Hashing a procedure object reliably

2025-04-11 Thread Zelphir Kaltstahl
On 11.04.25 21:49, Olivier Dion wrote: Hi Guile users! I have a hashing procedure that can hash many things like so: (define (hash value) (cond ((pair? value) (let loop ((elements value) (acc (srfi:hash '())) (k 1)) (if (null? el

Re: Handling modules with same name (from library and from current project)

2025-01-05 Thread Zelphir Kaltstahl
add a namespace as directory inside lib dir, pick your own unique project name as the namespace, say mylib, and define it as (define-module (mylib list-utils)) Best regards. Zelphir Kaltstahl 于 2025年1月5日周日 下午11:50写道: Hello Guile Users! I have a question regarding an issue I run int

Handling modules with same name (from library and from current project)

2025-01-05 Thread Zelphir Kaltstahl
Hello Guile Users! I have a question regarding an issue I run into again and again, and have not found an adequate solution for yet. I want to know how you are handling this, what your solution is. (1) recent story: I have a website, that I wrote manually in pure HTML and CSS. It does what i

Re: Control the order of expansion of syntax-case macros

2024-12-20 Thread Zelphir Kaltstahl
Hello Vivien On 17.12.24 17:33, Vivien Kraus wrote: Dear Guile users, syntax-case macros can have cool side effects at expansion time. However, they are still draped in a veil of mystery to me. Consider this code: (define-syntax hello (lambda (stx) (syntax-case stx () (_

Re: How to work with the tree produced by (ice-9 peg)'s match-pattern?

2024-12-06 Thread Zelphir Kaltstahl
On 06.12.24 20:45, Tomas Volf wrote: Hello, Zelphir Kaltstahl writes: Without getting into the details, perhaps my peg utils module could be useful for you: https://codeberg.org/ZelphirKaltstahl/advent-of-code-2024/src/commit/3f64ee60297ccc89085c9425522bd8b8e83fe99d/utils/peg-tree-utils.scm

Re: How to work with the tree produced by (ice-9 peg)'s match-pattern?

2024-12-04 Thread Zelphir Kaltstahl
On 04.12.24 13:06, Tomas Volf wrote: Hi :) I recently discovered the (ice-9 peg) module, and it seems really useful. However I have to admit I struggle a bit with processing the tree produced by it. Let me put forward an example: --8<---cut here---start->8-

question about PEG parsing - mutually recursive definitions

2024-10-03 Thread Zelphir Kaltstahl
Hello Guile Users, I have questions regarding Guile's PEG parsing library. Is it possible to have mutually recursive definitions of grammar rulse? I am asking this, because I am trying to write a grammar for org-mode files and that required handling nested inline markups like something bold, w

Re: Absolute path of source file

2024-09-24 Thread Zelphir Kaltstahl
Hello reza! On 23.09.24 17:47, reza wrote: Hi Retropikzel Perfect, works out of the box! I missed this part in the manual, just saw that it is in chapter "Source Properties" where I would never have guessed to look at. Thanks very much, Reza On Mon, 23 Sep 2024 15:35:03 + reza wrote: H

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:

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

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

2024-07-07 Thread Zelphir Kaltstahl
Hello Guile Users! I have questions regarding sets, functional sets from guile-pfds (https://github.com/ijp/pfds), to be precise: Is there a way to "find" an element in the set? I know that the sets are backed by balanced binary trees in guile-pfds and that those bbtrees have (bbtree-contain

Re: GNU Guile 3.0.10 released

2024-06-25 Thread Zelphir Kaltstahl
Thanks to all contributors for your work! Exciting to see Guile improving! On 23.06.24 23:56, Andy Wingo wrote: We are pleased to announce GNU Guile release 3.0.10, the latest in the 3.0 stable release series. Guile 3.0.10 is a bug-fix release which also adds optimizations, support for a new W

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

2024-05-28 Thread Zelphir Kaltstahl
Hello Pierre, To me it looks like the easiest way could be to think of a declarative description of your filters and put that into a JSON file and read that as input (or similar file format), rather than using a whole programming language. Is there a specific requirement, that makes a JSON fi

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

2024-05-10 Thread Zelphir Kaltstahl
On 10.05.24 15:47, Dr. Arne Babenhauserheide wrote: Hi, in #guile on IRC¹, old talked about Typed Racket so I thought whether that could be done with define-syntax-rule. So I created define-typed. This is also on my website², but I wanted to share and discuss it here. I follow the format by [sp

Understanding the assert macro from okmij.org

2024-03-20 Thread Zelphir Kaltstahl
Hello Guile users! Thanks to your help with understanding some of the macros involved in the assert macro from okmij.org, I think I now have the whole thing. Here is a link to a full explanation of how it works: https://codeberg.org/ZelphirKaltstahl/guile-examples/src/commit/be16f636a6ad637de

Re: Macro id-memv??, workings of tripple dot

2024-03-15 Thread Zelphir Kaltstahl
Hello Jean! On 3/15/24 09:03, Jean Abou Samra wrote: My question is: Do the ... in the case ((test id _kt _kf) _kt) ... produce one case for each identifier in the list? Yes, they do. I am guessing that this is what they do. However, they are mentioned as literals in the inner syntax-rul

Macro id-memv??, workings of tripple dot

2024-03-14 Thread Zelphir Kaltstahl
Hello Guile Users, I have another macro understanding question and I think I don't yet grasp all the usages of the ellipsis/tripple dot/... : Again it is a macro from https://okmij.org/ftp/Scheme/assert-syntax-rule.txt. This time the id-memv macro, which I think I mostly understand, but have

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

2024-03-14 Thread Zelphir Kaltstahl
On 3/14/24 02:01, Jean Abou Samra wrote: Hi! The explanations are on https://okmij.org/ftp/Scheme/macros.html#macro-symbol-p Maybe this version will be easier to understand (we don't really need continuation-passing style here): (define-syntax symbol?? (syntax-rules () ((symbol?? mayb

Understanding `symbol??` macro from okmij.org

2024-03-13 Thread Zelphir Kaltstahl
Hello Guile Users! I am having trouble understanding how the `symbol??` macro from https://okmij.org/ftp/Scheme/assert-syntax-rule.txt works. Here is what I have so far: start ;; (symbol?? FORM KT KF) ;; FORM is an arbitrary form or datum. ;; A symbol? predicate at the macro-expand ti

Re: symbol is nested in #{ ...... }#

2024-01-04 Thread Zelphir Kaltstahl
Hello Damien, That is probably, because keywords themselves can look different in Kawa and Racket. https://www.gnu.org/software/kawa/Keywords.html (mentions both syntaxes, but also mentions #:name being more portable) https://docs.racket-lang.org/guide/keywords.html (only mentions #:name syn

Re: Advice for importing things in a Guile module

2023-12-24 Thread Zelphir Kaltstahl
Hello Guile Users! Does anyone know more about this? I wish you all a merry Christmas or other holiday you might be celebrating. Zelphir On 6/29/23 11:35, Zelphir Kaltstahl wrote: Hello Guile Users! Due to https://lists.gnu.org/archive/html/guile-user/2023-06/msg00020.html I am currently

Re: Is it possible to write program only in Guile?

2023-10-18 Thread Zelphir Kaltstahl
On 10/18/23 12:23, CToID wrote: Hello guys, a common lisper here.  I've recently developed some interests in Guile, and wonder if I can make a program entirely written in Guile. The reason why I am asking this question is because Guile seems to be designed as an extension language that will be

Re: Scheme in the browser: A Hoot of a tale

2023-10-11 Thread Zelphir Kaltstahl
On 10/11/23 19:43, Christine Lemmer-Webber wrote: Friends, Guilers, Schemers, I am thrilled, pleased, et cetera to present you with the following: Guile Hoot can now compile real r7rs-small programs to code that runs in latest nightly browsers: https://spritely.institute/news/scheme-wireworld

Re: How to read a string output with `open-input-pipe` on Mac OS?

2023-10-10 Thread Zelphir Kaltstahl
On 10/10/23 02:49, Panisuan Chasinga wrote: Hi list, I want to read a string output using `ice-9/popen/open-input-pipe` but somehow always got an empty string. Here is my test code: (use-modules (ice-9 popen)) (use-modules (ice-9 textual-ports)) (define (test-read-port) (let* ((port (open-i

Re: Generating "independent" random numbers

2023-10-03 Thread Zelphir Kaltstahl
On 10/3/23 20:25, Maxime Devos wrote: Op 03-10-2023 om 17:08 schreef Zelphir Kaltstahl: Some time ago, I wanted to generate uniformly distributed floats though. There seems to be no facility in Guile to do that. So I took a look at Wikipedia: https://en.wikipedia.org/wiki/Normal_distribution

Re: Generating "independent" random numbers

2023-10-03 Thread Zelphir Kaltstahl
On 10/3/23 18:16, to...@tuxteam.de wrote: On Tue, Oct 03, 2023 at 06:04:45PM +0200, to...@tuxteam.de wrote: […] Perhaps something graphical (I hope y'all have fixed pitch fonts ;-) Uniform probability density (usually across some fixed interval, say [0,1) | |... |

Re: Generating "independent" random numbers

2023-10-03 Thread Zelphir Kaltstahl
On 10/3/23 18:04, to...@tuxteam.de wrote: On Tue, Oct 03, 2023 at 03:08:03PM +, Zelphir Kaltstahl wrote: Hello Guile Users, today I want to verify some understanding I have about generating random numbers using Guile. [...] Some time ago, I wanted to generate uniformly distributed

Generating "independent" random numbers

2023-10-03 Thread Zelphir Kaltstahl
Hello Guile Users, today I want to verify some understanding I have about generating random numbers using Guile. So there is SRFI-27 and I am using it like this: (define make-random-integer-generator (lambda* (#:key (seed #f)) "Get a procedure for generating uniformly distribut

Re: SRFI-27, deterministic random generator for floats

2023-09-29 Thread Zelphir Kaltstahl
On 9/29/23 02:18, Jeronimo Pellegrini wrote: On 2023-09-28 20:56, Zelphir Kaltstahl wrote: I am trying to deterministically generate random floats using SRFI-27 and I stumbled upon something weird: (use-modules (srfi srfi-27)) (define random-source (make-random-source)) (define random

SRFI-27, deterministic random generator for floats

2023-09-28 Thread Zelphir Kaltstahl
Hello Guile Users! I am trying to deterministically generate random floats using SRFI-27 and I stumbled upon something weird: (use-modules (srfi srfi-27)) (define random-source (make-random-source)) (define random-state (random-source-pseudo-randomize! random-source 0 12345)) (define ran

Re: message without subject

2023-08-01 Thread Zelphir Kaltstahl
On 8/1/23 11:53, Damien Mattei wrote: hello, i have this error: ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `("match" "no matching pattern" (1 0))'. i thought it was a 'match' related error as i used it in a macro: ;;(display "before match") (n

Advice for importing things in a Guile module

2023-06-29 Thread Zelphir Kaltstahl
Hello Guile Users! Due to https://lists.gnu.org/archive/html/guile-user/2023-06/msg00020.html I am currently relying on `define-module', instead of `library'. However, I have not found a way to do the `(import (except (something) excluded-binding ...))' thing. So I have imports looking like th

Re: Python slices in Scheme

2023-06-19 Thread Zelphir Kaltstahl
On 6/19/23 18:36, lloda wrote: My library guile-newra (1) has quite general multidimensional array slicing. The indices can be linear ranges or arbitrary integer arrays and they can have any rank. You can also use the indexed array as write target. If all the indices are linear ranges then the

Re: Guile import issue

2023-06-15 Thread Zelphir Kaltstahl
On 6/15/23 11:59, Unstable Horse wrote: Hmm, if I rewrite your rectangular.scm to: rectangular.scm (define-module (rectangular) #:use-module ((guile) #:select ((lambda* . λ))) #:export (real-part)) (define real-part (λ (num) (car num))) This works both with `import'

Re: Guile import issue

2023-06-15 Thread Zelphir Kaltstahl
On 6/15/23 12:33, Jean Abou Samra wrote: Le jeudi 15 juin 2023 à 12:29 +0200, Jean Abou Samra a écrit : As you can see, the library macro has turned the (export real-part) part into a re-export from (guile). Sigh. This is the code from |module/ice-9/r6rs-libraries.scm|: |(define (compute-e

Guile import issue

2023-06-14 Thread Zelphir Kaltstahl
Hello Guile Users! I have now created a minimal example of the import bug or issue I am observing: rectangular.scm (library (rectangular) (export real-part) (import (except (rnrs base) error) (only (guile) lambda* λ)) (define real-part (λ (num)

Weird behavior or bug for imports of functions with names of built-in functions

2023-06-10 Thread Zelphir Kaltstahl
Hello Guile Users! Today I came across some weird behavior or perhaps even a bug. I will describe it in the following. It seems like when I define a function, that has the same name as a built-in function, inside a (library ...) and then import that library with a (prefix (lib-name) my-prefi

Re: Directly compiling Scheme to WebAssembly: lambdas, recursion, iteration!

2023-05-31 Thread Zelphir Kaltstahl
On 5/30/23 19:59, Christine Lemmer-Webber wrote: The Hoot team (meaning really Andy Wingo and Robin Templeton) have been hard at work bringing that dream to life. We don't have full r7rs-small scheme *yet* but... we're on our way! :) Here's an update! https://spritely.institute/news/scheme-

Concurrently write (out) and read (in) from ports

2023-04-11 Thread Zelphir Kaltstahl
Hi Guile users! I am currently trying to concurrently write to an output port and read from the corresponding input port, but something I am doing wrong and it does not work as I expected it to. Here is what I have tried so far: (import ;; ports (ice-9 popen) (ice-9 textual-ports) (

Re: GPT-4 knows Guile! :)

2023-03-20 Thread Zelphir Kaltstahl
On 3/20/23 00:18, Dr. Arne Babenhauserheide wrote: writes: which has tried to be free (in both senses). For images, there is Stable Diffusion (disclaimer:I don't know much about them). For raw data, there's Common Crawl [3], which is Stable Diffusion's Stable diffusion has one of the most evil

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-08 Thread Zelphir Kaltstahl
On 1/8/23 16:55, Olivier Dion wrote: On Sun, 08 Jan 2023, Zelphir Kaltstahl wrote: user@user-desktop:~/dev/advent-of-code-2022/day-14$ guix shell \ --file=guile-parallel/.guix.scm \ --with-source=guile-parallel=guile-parallel user@user-desktop:~/dev/advent-of-code-2022/day

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-08 Thread Zelphir Kaltstahl
On 1/8/23 15:44, Olivier Dion wrote: On Sun, 08 Jan 2023, Zelphir Kaltstahl wrote: On 12/31/22 21:31, Olivier Dion wrote: On Sat, 31 Dec 2022, Zelphir Kaltstahl wrote: Maybe I can already make use of it in coming AoC puzzles. Any sort of feeback is welcome! Hello Olivier! May I ask

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-08 Thread Zelphir Kaltstahl
On 12/31/22 21:31, Olivier Dion wrote: On Sat, 31 Dec 2022, Zelphir Kaltstahl wrote: Maybe I can already make use of it in coming AoC puzzles. Any sort of feeback is welcome! Hello Olivier! May I ask how to make use of the library? I cloned the project onto my local machine in a

Re: Exception with multiple irritants

2023-01-08 Thread Zelphir Kaltstahl
On 11/25/22 01:03, Zelphir Kaltstahl wrote: Hello Guile Users! I have a question regarding exception creation in general and maybe in specific about irritants. I created a new exception type: (library (exceptions)   (export make-contract-violated-exception-plain   make

Re: [ANN] Guile-Parallel 1.0.0 released

2022-12-31 Thread Zelphir Kaltstahl
Hello Olivier! On 12/31/22 04:55, Olivier Dion via General Guile related discussions wrote: Hi Guilers, I'm happy to announce the first release of guile-parallel. A library that offers primitives for parallelization of your programs. Project page: List

Exception with multiple irritants

2022-11-24 Thread Zelphir Kaltstahl
Hello Guile Users! I have a question regarding exception creation in general and maybe in specific about irritants. I created a new exception type: (library (exceptions) (export make-contract-violated-exception-plain make-exception-contract-violated-compound &contra

Re: map-par slower than map

2022-11-11 Thread Zelphir Kaltstahl
Hi! On 11/11/22 11:26, Damien Mattei wrote: i rewrote a complete threaded routine both with guile and racket creating threads and waiting they finish : ;; run the parallel code   {threads <+ (map (λ (seg) (call-with-new-thread     (λ () (proc-unify-minterms-seg seg   segmts)}   (nodebug  

Re: map-par slower than map

2022-11-10 Thread Zelphir Kaltstahl
ouching future")    (touch f))  futures)]) segment-results ;; (reduce reduce-proc ;; reduce-init ;; segment-results) )))) Best regards, Damien On Wed, Oct 12, 2022 at 11:29 PM Zelphir Kaltstahl wrote: Hi! On 10/12/22 22:27, Damie

Re: escaping from a recursive call

2022-11-09 Thread Zelphir Kaltstahl
Hello Damien, On 11/9/22 18:18, Damien Mattei wrote: but in the general case , i want a macro that can do it on any function (i'm not sure it can be done because the continuation have to be captured just before the call to the function and be inlined at the good place) On Wed, Nov 9, 2022

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

2022-11-07 Thread Zelphir Kaltstahl
Hi! I think the only way to use multiple cores in Racket is to use "places" and that means starting new Racket VMs. Lambdas are not easily serialized with all their environment, so it is difficult to actually "send a lambda" to another "place" (Racket VM) dynamically. The only way I found wa

Re: map-par slower than map

2022-10-24 Thread Zelphir Kaltstahl
Hello Keith! On 10/24/22 05:56, Keith Wright wrote: Zelphir Kaltstahl writes: Of course,if you have global state and do not have a synchronization construct for accessing the hash table, I would expect things to go wrong at some point, with non-reproducible results. Indeed. I do not think

Re: map-par slower than map

2022-10-23 Thread Zelphir Kaltstahl
Hello Damien! On 10/23/22 03:06, Damien Mattei wrote: after intense coding i finally got the good results, my assumption about the global variable hash table was true ,it is incompatible with 'future : the competition for the writing into the hash table breaks the code. If i do writing in ha

Re: map-par slower than map

2022-10-14 Thread Zelphir Kaltstahl
Hello Damien, On 10/14/22 10:21, Damien Mattei wrote: yes Zelphir i think there is a problem in the threading part of guile, whatever the code is ,it run well the first time, and after is unstable. Long ago at the very begin of Java language on my master project at university i experienced sam

Re: map-par slower than map

2022-10-12 Thread Zelphir Kaltstahl
Hi! On 10/12/22 22:27, Damien Mattei wrote: https://github.com/damien-mattei/library-FunctProg/blob/master/guile/logiki%2B.scm#L1674 i commited the current version of code here with all files but it is huge :-/ On Wed, Oct 12, 2022 at 10:20 PM Damien Mattei wrote: Mutex? i do not think

Re: case source code

2022-09-12 Thread Zelphir Kaltstahl
Hello Damien, On 9/12/22 09:42, Damien Mattei wrote: Hello, i can not find in the scheme community a definition of 'case in term of macro as for when, unless,while,do... does anyone have it? thanks, Damien Can you give an example of what form you mean? Regards, Zelphir -- repositories: https

I've made a sound/audio thing

2022-09-04 Thread Zelphir Kaltstahl
Hello Guile users! Recently I've looked at "how to write a wav file?" and wrote some code to output in RIFF-WAVE fie format: https://notabug.org/ZelphirKaltstahl/guile-examples/src/master/sound/riff-wave. It only writes a file currently, and does not read in any files yet. Hopefully I will wo

Re: How can i make executable guile file to process command line arguments?

2022-08-18 Thread Zelphir Kaltstahl
Hello Jacob, On 8/18/22 16:01, Jacob Hrbek wrote: I have this file which i use to interact with a version controlled repository similar to a Makefile. How can i make it work with e.g. `./file.scm echo wheee` -> Will execute the `(define (echo msg) ...)` and output `wheee` in the terminal? F

Re: Macro for replacing a placeholder in an expression

2022-08-06 Thread Zelphir Kaltstahl
Hello Linus! On 8/5/22 11:42, Linus Björnstam wrote: I wrote this, which does a tree fold over a sexp: https://hg.sr.ht/~bjoli/megacut/browse/readme.txt?rev=tip It is unhygienic currently, and I will probably never change because I only use it at the repl. The code is really just a syntax-ca

Re: Macro for replacing a placeholder in an expression

2022-07-30 Thread Zelphir Kaltstahl
Hi Maxime! On 7/28/22 12:23, Zelphir Kaltstahl wrote: Hello Maxime! On 7/28/22 02:55, Maxime Devos wrote: 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 #(...). ;;

Re: Macro for replacing a placeholder in an expression

2022-07-28 Thread Zelphir Kaltstahl
On 7/28/22 11:48, Maxime Devos wrote: 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

Re: Macro for replacing a placeholder in an expression

2022-07-28 Thread Zelphir Kaltstahl
Hello Maxime! On 7/28/22 02:55, Maxime Devos wrote: 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 replac

Re: Macro for replacing a placeholder in an expression

2022-07-28 Thread Zelphir Kaltstahl
Hello Maxime! Thank you for your quick response! (Mailing list saves me again! Yay!) On 7/28/22 03:04, Maxime Devos wrote: On 28-07-2022 01:57, Zelphir Kaltstahl wrote: scheme@(guile-user)> (define-syntax test   (syntax-rules (lambda)     [(_ (op args body* ...)) ((test op) (test a

Macro for replacing a placeholder in an expression

2022-07-27 Thread Zelphir Kaltstahl
Hello Guile Users, I am trying to write a macro, which replaces all placeholders (in this case ) with an identifier in an arbitrarily structured expression (arbitrary nesting of expressions). I have the following code now: (define-syntax replace-result-placeholder (syntax-rules ( repla

Re: Contracts macro example

2022-07-23 Thread Zelphir Kaltstahl
rds, Zelphir On 7/20/22 10:55, Maxime Devos wrote: 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

Re: Contracts macro example

2022-07-20 Thread Zelphir Kaltstahl
Hello Maxime! On 7/19/22 17:20, Maxime Devos wrote: 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* ...)] In

Re: Using guile (running on a port) in Org Mode

2022-07-15 Thread Zelphir Kaltstahl
Hello Munyoki! On 7/15/22 16:44, Munyoki Kilyungi wrote: Tim Van den Langenbergh anaandika: Munyoki Kilyungi writes: [[PGP Signed Part:Undecided]] Hi Guilers! Recently I worked out a way to point an org src block to any python environment I want:

Contracts macro example

2022-07-14 Thread Zelphir Kaltstahl
Hello Guile users! I've tried myself again at writing some macros. Some post about programming language features inspired me to try and write a macro, which adds contracts (or my naive idea of what they are) to function definitions. The code is at: https://notabug.org/ZelphirKaltstahl/guile-

Re: Guile Steel: a proposal for a systems lisp

2022-07-10 Thread Zelphir Kaltstahl
I am usually quite far away from the metal and how things work on the bits level, however, if there was a Guile dialect, or Scheme dialect, which has similar feel, or maybe can even use Guile libraries, I would find that interesting. There is probably a lot to learn for me in that area. I bega

Re: Scripting for installing a module

2022-07-03 Thread Zelphir Kaltstahl
On 7/3/22 09:35, James Crake-Merani wrote: On 22/07/02 07:43pm, Zelphir Kaltstahl wrote: On 7/2/22 10:46, James Crake-Merani wrote: On 22/07/02 09:11am, adriano wrote: Il giorno ven, 01/07/2022 alle 18.15 +0100, James Crake-Merani ha scritto: Hello, I was just wondering what approach

Re: Scripting for installing a module

2022-07-02 Thread Zelphir Kaltstahl
On 7/2/22 10:46, James Crake-Merani wrote: On 22/07/02 09:11am, adriano wrote: Il giorno ven, 01/07/2022 alle 18.15 +0100, James Crake-Merani ha scritto: Hello, I was just wondering what approach people tend to take when writing a script which installs a module onto the load-path. I understa

Re: Indentation with inline comments in Emacs

2022-04-18 Thread Zelphir Kaltstahl
Hi Maxime! On 4/17/22 16:58, Maxime Devos wrote: Zelphir Kaltstahl schreef op zo 17-04-2022 om 11:06 [+]: I never understood, why Emacs indented that way, but now I understand. First argument is seen as special, as the function/procedure that is being called – aha! I do not know, whether

Re: Indentation with inline comments in Emacs

2022-04-18 Thread Zelphir Kaltstahl
Hello Felipe! On 4/17/22 15:44, Luis Felipe wrote: Hi Zelphir, On Sunday, April 17th, 2022 at 10:49 AM, Zelphir Kaltstahl wrote: I have the same indentation issue though, when I use #||# comments for arguments, which are not keyword arguments, but I want to hint what they are used for. One

Re: Indentation with inline comments in Emacs

2022-04-17 Thread Zelphir Kaltstahl
Hello Taylan! On 4/17/22 05:03, Taylan Kammer wrote: On 16.04.2022 14:12, Zelphir Kaltstahl wrote: Hello Guile users! The subject might not be only Guile related, but I figure, that many on this mailing list are using Emacs for writing Guile code. I wonder, if anyone has some trick for

Re: Indentation with inline comments in Emacs

2022-04-17 Thread Zelphir Kaltstahl
Hello Jérémy! On 4/16/22 16:57, Jérémy Korwin-Zmijowski wrote: Yo Zelphir, I would replace numbers with a constant name which avoid the need for comments. Sorry, not an Emacs solution. I just keep comments for outside context. Cheers! This is an idea. I'll consider that approach! I have th

Indentation with inline comments in Emacs

2022-04-16 Thread Zelphir Kaltstahl
Hello Guile users! The subject might not be only Guile related, but I figure, that many on this mailing list are using Emacs for writing Guile code. I wonder, if anyone has some trick for fixing the following indentation issue: Sometimes I want to put inline comments with #||# in things like

Re: Exception handling - symbol for encoding exception type?

2022-04-07 Thread Zelphir Kaltstahl
Hi Maxime! On 3/8/22 19:20, Maxime Devos wrote: Zelphir Kaltstahl schreef op di 08-03-2022 om 17:11 [+]:    (make-non-continuable-error) IIRC, 'make-non-continuable-error' indicates that someone tried to continue into a raise-exception that wasn't continuable. I

Re: Weird cache issue

2022-03-15 Thread Zelphir Kaltstahl
I think I was code blind there. >.< Thanks for highlighting that one. On 3/15/22 20:04, Maxime Devos wrote: Zelphir Kaltstahl schreef op di 15-03-2022 om 17:54 [+]: 013.scm (library (fileio) Shouldn't this be (library (#{013}#) ...) instead of (libr

Re: Weird cache issue

2022-03-15 Thread Zelphir Kaltstahl
Hi Maxime! On 3/15/22 20:10, Maxime Devos wrote: Zelphir Kaltstahl schreef op di 15-03-2022 om 17:54 [+]: 013.scm (library (fileio)    (export )    (import     (except (rnrs base) let-values)     (only (guile)   lambda* λ   ;; printing   display

Weird cache issue

2022-03-15 Thread Zelphir Kaltstahl
Hello Guile users! I have a weird cache issue: I have a directory, where I have the following files: "fileio.scm" and "013.scm". The following shows the contents of the files: fileio.scm (library (fileio) (export get-string-from-file get-lines-from-file get-lines

Re: Question about an error with ports

2022-03-10 Thread Zelphir Kaltstahl
Hello Olivier! On 3/10/22 16:05, Olivier Dion wrote: On Thu, 10 Mar 2022, Zelphir Kaltstahl wrote: I have the following questions: (1) Is the read-from-write-to procedure useful at all, or is there a better way to get all stuff from an input port and output it to an output port, avoiding

Question about an error with ports

2022-03-09 Thread Zelphir Kaltstahl
Hello Guile Users! I have some code at https://notabug.org/ZelphirKaltstahl/guile-examples/src/63af5250aa5a45d68bc6bd2d6193d2a6fb127f24/shell/example-04-using-popen-get-out-and-error-with-ports.scm: (import (ice-9 popen) (ice-9 textual-ports) (ice-9 binary-ports) (

Re: Shell commands with output to string

2022-03-08 Thread Zelphir Kaltstahl
Hello Josselin and all! On 2/23/22 15:01, Josselin Poiret wrote: Hello, p...@thomasdanckaert.be writes: Hi, to throw in an example: I once used a function like the one below to handle stdout and stderr from external commands (from https://github.com/tdanckaert/jobview/blob/master/jobtools.

  1   2   3   4   >