Re: Write a macro which defines a procedure

2019-07-20 Thread Matt Wette
On 7/19/19 3:51 PM, zelphirkaltstahl wrote: (module-define! (current-module) ;; `route` should be `/container/json` for example. route (quote route)

[ANN] nyacc version 0.99.0 released

2019-07-20 Thread Matt Wette
NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers. It also provides sample parsers and pretty-printers using SXML trees as an intermediate representation. It provides a decent C parser and a `FFI Helper' tool to help create Guile S

Re: [ANN] nyacc version 0.99.0 released

2019-07-20 Thread Matt Wette
On 7/20/19 10:21 AM, pelzflorian (Florian Pelz) wrote: On Sat, Jul 20, 2019 at 07:54:21AM -0700, Matt Wette wrote: The next major release will be 1.0. If you are currently using nyacc please give this a try. I want to have a clean, working 1.0 release. Thank you for your work! I never used

Re: Failing to run Foreign Object example

2019-08-04 Thread Matt Wette
On 8/4/19 3:13 PM, Martin Michel wrote: Hi there, I want to extend a C++ program with Guile, mainly for configuration and parameter scripting. For this, I need access class objects and methods. I could not found simple examples so I started to experiment with Smobs and only by chance find out th

Re: Maintainership changes: many thanks to Mark!

2019-09-12 Thread Matt Wette
Mark, Thanks so much for being a major factor in the success of Guile as maintainer. And I really appreciate all the help through the years on so many other issues.  You have provided great help in my understanding in Scheme macros, Guile CPS and many other areas. Matt

Re: Integrate Guile with GNU Scientific Library

2019-10-03 Thread Matt Wette
On 10/3/19 12:28 AM, Freeduck via General Guile related discussions wrote: Hi All, I am trying to integrate Guile with a part of GNU Scientific Library and have found SWIG, which seems very easy to use, but only supports Guile 2.0. I have Guile 2.2 installed. The Guile homepage has a tutorial

Re: Integrate Guile with GNU Scientific Library

2019-10-04 Thread Matt Wette
On 10/3/19 6:10 PM, Matt Wette wrote: The FFI Helper in nyacc (https://savannah.nongnu.org/projects/nyacc) provides the functionality of swig.  You can try that.  I'd be interested in how you like that compared to swig. I found cpp-defs may be necessary for gsl: (define-ffi-module

(dynamic-link "libm") fails [was Re: Integrate Guile with GNU Scientific Library]

2019-10-05 Thread Matt Wette
RTLD_NOW);     printf("%p\n", p);   }   mwette$ gcc z2.c -ldl   mwette$ ./a.out   (nil) Matt On 10/3/19 6:10 PM, Matt Wette wrote: $ guild compile-ffi gsl-sort.ffi ... ERROR: In procedure dynamic-link: In procedure dynamic-link: file: "libm", message: "file not found&quo

Re: Interactive Debugging

2019-10-18 Thread Matt Wette
On 10/17/19 9:39 PM, Christopher Howard wrote: Hi, it seems like with the flexibility of Guile, I should be able to do something like this: ```(define (foo)  (let ((a 1)(b 2)(c 3))(jump-into- debugging-repl)))``` And have access to a, b, and c and their values. But I'm not qui

Re: Interactive Debugging

2019-10-19 Thread Matt Wette
Below is something I played with years ago. I'm not sure kill-opt is up to date. Try with > (load "jtd.scm") > (foo) [1]> ,loc ;; potluck/jtd - jump to debugger, detour to debugger ;;(define-module (potluck jtd) #:export (kill-opt trap-here foo)) (use-modules (system repl repl))

Re: Interactive Debugging

2019-10-19 Thread Matt Wette
On 10/19/19 12:04 PM, Christopher Howard wrote: Below is something I played with years ago.  I'm not sure kill-opt is up to date.   Try with    > (load "jtd.scm")    > (foo)    [1]> ,loc The code seems to evaluate fine, but does not produce useful results: ``` scheme@(guile-user)> ,use (po

Re: Nyacc and guile-nearly-3.0 (progress report)

2019-12-02 Thread Matt Wette
Look at etc/README.  Maybe edit etc/configure.ac and rerun as in the README. I'm building 2.9.5 now but running into errors (ubuntu 18.04): /bin/bash: line 6: 14657 Segmentation fault  (core dumped) GUILE_AUTO_COMPILE=0 ../meta/build-env guild compile --target="x86_64-pc-linux-gnu" -O1 -Ore

2.9.5 build segfault on Ubuntu 18.04 [WAS: Nyacc and guile-nearly-3.0 (progress report)]

2019-12-02 Thread Matt Wette
On 12/2/19 6:28 AM, Matt Wette wrote: I'm building 2.9.5 now but running into errors (ubuntu 18.04): /bin/bash: line 6: 14657 Segmentation fault  (core dumped) GUILE_AUTO_COMPILE=0 ../meta/build-env guild compile --target="x86_64-pc-linux-gnu" -O1 -Oresolve-primitives -L

Re: Nyacc and guile-nearly-3.0 (progress report)

2019-12-03 Thread Matt Wette
The segfault is not in bash.  I was able to re-create the segfault from the (bash) command-line. On 12/3/19 1:25 AM, Arne Babenhauserheide wrote: to...@tuxteam.de writes: On Mon, Dec 02, 2019 at 06:28:53AM -0800, Matt Wette wrote: Look at etc/README. Maybe edit etc/configure.ac and rerun

Re: Nyacc and guile-nearly-3.0

2019-12-04 Thread Matt Wette
On 12/4/19 1:04 PM, to...@tuxteam.de wrote: Matt says that he had to remove "-Oresolve-primitives" from the compiler options. I hadn't -- but I suspect this option isn't set by default... I apologize if I generated confusion.  I was intending to build 2.9.5 to help debug the nyacc issue. Th

[ANN] nyacc 0.99.3 released

2019-12-15 Thread Matt Wette
I am releasing another pre-1.00 version as some non-trivial fixes have been added. oops: Not mentioned in NEWS is that Makefiles now use "$(MAKE)" instead of "make" NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers. It also prov

[ANN] nyacc 1.00.0 released

2019-12-23 Thread Matt Wette
Hi All, I am finally pushing out a 1.0 release of nyacc. NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers.  It also provides sample parsers and pretty-printers using SXML trees as an intermediate representation. It provides a dec

Re: [ANN] nyacc 1.00.0 released

2019-12-29 Thread Matt Wette
On 12/29/19 6:23 AM, Jan Nieuwenhuizen wrote: Wow, congrats! An amazing piece of work. Thank you. Trying to update the Nyacc package in Guix, I found that Mes does not build with 1.00.0. When FOO is not defined, this --8<---cut here---start->8--- #if F

[ANN] nyacc 1.00.1 released

2019-12-29 Thread Matt Wette
I have released version 1.00.1 of nyacc.  This fixes a few issues w/ 1.00.0. NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers.  It also provides sample parsers and pretty-printers using SXML trees as an intermediate representation.

Re: GNU Guile 2.9.8 Released [beta]

2020-01-03 Thread Matt Wette
In nyacc-1.00.1 I use: GUILE_PKG([3.2 3.0 2.9 2.2 2.0]) GUILE_PROGS The above works w/ 2.9.7 (aka 3.0).  I am running into other issues, however, when there is a guile in my path that appears before anything else, but a guile-2 that appears from another directory.  I am working to add --with-g

Re: GNU Guile 2.9.8 Released [beta]

2020-01-03 Thread Matt Wette
On 1/3/20 6:29 AM, Matt Wette wrote: In nyacc-1.00.1 I use: GUILE_PKG([3.2 3.0 2.9 2.2 2.0]) GUILE_PROGS The above works w/ 2.9.7 (aka 3.0). and I'm using the guile.m4 from 2.9.7  I am running into other issues, however, when there is a guile in my path that appears before any

configuring guile packages [was: GNU Guile 2.9.8 Released [beta]]

2020-01-03 Thread Matt Wette
On 1/3/20 6:53 AM, Matt Wette wrote:  I am running into other issues, however, when there is a guile in my path that appears before anything else, but a guile-2 that appears from another directory.  I am working to add --with-guile to fix that.  I'm having problems checking against 2

Re: configuring guile packages [was: GNU Guile 2.9.8 Released [beta]]

2020-01-03 Thread Matt Wette
On 1/3/20 10:44 AM, Matt Wette wrote: On 1/3/20 6:53 AM, Matt Wette wrote:  I am running into other issues, however, when there is a guile in my path that appears before anything else, but a guile-2 that appears from another directory.  I am working to add --with-guile to fix that.  I&#

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

2020-01-11 Thread Matt Wette
On 1/10/20 2:36 PM, Linas Vepstas wrote: So, I've got lots of C code wrapped up in guile, and I'd like to declare many of these functions to be pure functions, side-effect-free, thus hopefully garnering some optimizations. Is this possible? How would I do it? A cursory google-search reveals no c

Re: cat segfaults when compiling Guile 3.0

2020-01-19 Thread Matt Wette
On 1/19/20 1:46 PM, flyn...@tutanota.com wrote: Hello, Guile Users: I was compiling Guile 3.0 on 64-bit Ubuntu 18.04. The configure script was run successfully. A problem occurred running the Makefile. In the process of generating `guile-procedures.texi`, I think `cat` crashed, causing a br

Re: cat segfaults when compiling Guile 3.0

2020-01-19 Thread Matt Wette
On 1/19/20 3:38 PM, flyn...@tutanota.com wrote: It seems to be saying it can't find ice-9/boot9.scm.at the top directory can you do this? I can't find the `ice-9` folder from the top level. I can find `ice-9` in `module/` and in the prebuilt directories. This is the tarball: $ sha256sum guil

Re: Geiser vs. guile-mode?

2020-02-07 Thread Matt Wette
Thanks for doing this.   I'd like to have #! ... !# handled robustly as comment. It's not working for me and I believe I saw a comment in the code that it was intentionally left out (for some reason I don't remember). On 2/7/20 8:19 AM, Jérémy Korwin-Zmijowski wrote: This is great news Pierre

Re: Geiser vs. guile-mode?

2020-02-07 Thread Matt Wette
On 2/7/20 9:50 AM, sirgazil wrote: On Fri, 07 Feb 2020 11:30:43 -0500 Matt Wette wrote > Thanks for doing this. I'd like to have #! ... !# handled robustly as > comment. > It's not working for me and I believe I saw a comment in the code that > it

Re: Geiser vs. guile-mode?

2020-02-08 Thread Matt Wette
On 2/8/20 10:14 AM, Ricardo Wurmus wrote: Matt Wette writes: On 2/7/20 9:50 AM, sirgazil wrote: On Fri, 07 Feb 2020 11:30:43 -0500 Matt Wette wrote > Thanks for doing this. I'd like to have #! ... !# handled robustly as > comment. > It's not w

configuring apps for guile

2020-02-12 Thread Matt Wette
Hi All, Over the last year I have been dealing with issues getting a configure.ac put together for my guile app.  It needs to install .scm and .go files into the place guile expects to see them: (%site-ccache-dir) and %load-path.   If I compile for my ubuntu system then the installed go files

Re: configuring apps for guile

2020-02-12 Thread Matt Wette
On 2/12/20 5:54 AM, Matt Wette wrote: Here is my solution.  What do you think?  If $prefix is the same as used to build guile then I use the directories from $guile.  Otherwise, I use the default.  This now works on ubuntu and guix. CorrectIon: "directories from $guile" means

Re: help with peg module and character classes

2020-02-13 Thread Matt Wette
On 2/13/20 11:37 AM, Malte Frank Gerdes wrote: Hey guile-user, i'm currently trying to use the peg module to parse android bp files. I have never used pegs before so i might have done an obvious mistake. Maybe start with something simple.   I hacked this today.  First PEG program. Though I

Re: help with peg module and character classes

2020-02-14 Thread Matt Wette
On 2/13/20 11:37 AM, Malte Frank Gerdes wrote: Hey guile-user, i'm currently trying to use the peg module to parse android bp files. I have never used pegs before so i might have done an obvious mistake. I got farther.  For an input string of (define global1   "cc_library {     name: \"libc

Re: configuring apps for guile

2020-02-16 Thread Matt Wette
On 2/16/20 6:48 AM, Ludovic Courtès wrote: Hello Matt, Matt Wette skribis: From configure.ac: guile_build_prefix=`$GUILE -c "(display (assq-ref %guile-build-info 'prefix))"` if test "$guile_build_prefix" == "$prefix"; then   echo "using path

Re: configuring apps for guile

2020-02-16 Thread Matt Wette
On 2/16/20 7:28 AM, Matt Wette wrote: On 2/16/20 6:48 AM, Ludovic Courtès wrote:    moddir = $(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)    godir  = $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache What if you have a system that gives this (e.g., Ubuntu 18.04): mwette$ /usr/bin

Re: configuring apps for guile

2020-02-16 Thread Matt Wette
On 2/16/20 7:43 AM, Matt Wette wrote: And for me, things get more bizarre.  If I have another guile installed in my path under /opt/local I get   mwette$ /usr/bin/guile -c "(display (%site-ccache-dir)) (newline)"   /opt/local/lib/guile/2.2/site-ccache I think this has somet

Re: configuring apps for guile

2020-02-16 Thread Matt Wette
On 2/16/20 9:57 AM, Ludovic Courtès wrote: Hi, Matt Wette skribis: What if you have a system that gives this (e.g., Ubuntu 18.04): mwette$ /usr/bin/guile -c "(display (assq-ref %guile-build-info 'prefix)) (newline)" /usr mwette$ /usr/bin/guile -c "(display (%site-c

[ANN] nyacc 1.01.1 released

2020-02-22 Thread Matt Wette
[note: guix package spec included below] NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers.  It also provides sample parsers and pretty-printers using SXML trees as an intermediate representation. It provides a decent C parser and

Re: YAML parser?

2020-02-23 Thread Matt Wette
On 2/21/20 8:12 PM, Aleix Conchillo Flaqué wrote: Hi, does anyone know if there's any YAML parser for Guile? Haven't been able to find any. Thanks! Aleix Hi Aleix, I don't know of a YAML parser for Guile, but if you look at my email posted 2/22 I have a Guile package called NYACC.  This in

Re: YAML parser?

2020-02-24 Thread Matt Wette
On 2/23/20 7:29 AM, Matt Wette wrote: On 2/21/20 8:12 PM, Aleix Conchillo Flaqué wrote: Hi, does anyone know if there's any YAML parser for Guile? Haven't been able to find any. Thanks! Aleix Hi Aleix, I don't know of a YAML parser for Guile, but if you look at my ema

Re: YAML parser?

2020-03-04 Thread Matt Wette
On 2/23/20 7:29 AM, Matt Wette wrote: On 2/21/20 8:12 PM, Aleix Conchillo Flaqué wrote: Hi, does anyone know if there's any YAML parser for Guile? Haven't been able to find any. Thanks! Aleix Hi Aleix, I don't know of a YAML parser for Guile, but if you look at my email

Re: Nyacc question: where are the actions bound?

2020-03-08 Thread Matt Wette
On 3/8/20 3:14 AM, to...@tuxteam.de wrote: Hi, I'm playing around with Nyacc: I found a first little use case to get my feet wet. First of all, than you, Matt, for this impressive package. Shamelessly stolen from the minimal example, playground looks roughly like this: #+begin_source schem

Guy Steele's comment on Java positioning

2020-03-10 Thread Matt Wette
I ran across an article on Closure.  It starts by noting that this year will mark the 25th anniversary of Java.  I love this quote from the article discussing the positioning of Java: "We were after the C++ programmers.  We managed to drag a lot of them about halfway to Lisp."  -- Guy Steele, c

[ANN] nyacc 1.01.2 released

2020-03-13 Thread Matt Wette
NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers.  It also provides sample parsers and pretty-printers using SXML trees as an intermediate representation. It provides a decent C parser and a `FFI Helper' tool to help create Guile S

Re: Nyacc question: [found] where are the actions bound?

2020-03-14 Thread Matt Wette
On 3/14/20 4:59 AM, to...@tuxteam.de wrote: On Sun, Mar 08, 2020 at 08:10:50AM -0700, Matt Wette wrote: On 3/8/20 3:14 AM, to...@tuxteam.de wrote: Hi, [...] My question is: where is the stuff resolved which is mentioned in grammar actions? Hah. Managed to answer my own question by reading

Re: Incomplete backtrace

2020-03-14 Thread Matt Wette
On 3/14/20 7:19 AM, Christopher Howard wrote: I think there are others here better qualified to answer your question, but maybe one helpful thing: have you read the Guile Implementation section of the Guile Reference Manual? In subsection "A Virtual Machine for Guile" there is this paragraph:

Re: Nyacc: how to lex comments?

2020-03-16 Thread Matt Wette
On 3/16/20 2:39 PM, to...@tuxteam.de wrote: Hi, in my quest to play parsing, I'm failing when I try to cope with comments. Here's an excerpt from my current file (define my-grammar (lalr-spec (start my-file) (grammar ;; boring grammar details elided

Re: Nyacc: how to lex comments?

2020-03-17 Thread Matt Wette
On 3/17/20 12:46 AM, to...@tuxteam.de wrote: On Mon, Mar 16, 2020 at 05:11:59PM -0700, Matt Wette wrote: On 3/16/20 2:39 PM, to...@tuxteam.de wrote: Hi, in my quest to play parsing, I'm failing when I try to cope with comments. [...] make-comm-reader will not eat newlines at e

Re: question about values

2020-03-18 Thread Matt Wette
On 3/18/20 2:55 AM, Massimiliano Gubinelli wrote: I understand the point but then it comes to the problem how to handle this in macros. For example if bar is a proceduce which returns multiple values and I have a macro "my-macro" which wraps the call with some initialization and finalization

Re: Error: ("primitive-load-path" "Unable to find file ~S in load path" ("ice-9/boot-9") #f)Abort

2020-03-20 Thread Matt Wette
On 3/19/20 8:43 PM, Nicholas Papadonis wrote: I recently compiled guile from GitHub. This error is encountered. Does anyone know how to resolve this and invoke Guile? Thanks $ /usr/local/bin/guile Pre-boot error; key: misc-error, args: ("primitive-load-path" "Unable to find file ~S in load pa

confused about make-module and eval

2020-03-23 Thread Matt Wette
I expect this to work, but it does not. Any anyone elaborate? What is the minimum module that can make this work? (make-fresh-use-module)? scheme@(guile-user)> (eval '(lambda (a b c) 1) (make-module)) ice-9/boot-9.scm:1669:16: In procedure raise-exception: Unbound variable: lambda Entering a n

Re: YAML parser?

2020-03-24 Thread Matt Wette
On 3/4/20 6:21 AM, Matt Wette wrote: On 2/23/20 7:29 AM, Matt Wette wrote: On 2/21/20 8:12 PM, Aleix Conchillo Flaqué wrote: Hi, does anyone know if there's any YAML parser for Guile? Haven't been able to find any. Thanks! Aleix Hi Aleix, I don't know of a YAML parser fo

syntax taste: use of unquote in macros

2020-03-29 Thread Matt Wette
Hi All, I'm not sure if you know about this, but there is a discrepancy in the way some folks define macros to use unquote (aka ,).   For example, > (use-modules (system base pmatch)) > (pmatch '(foo "bar")  ((foo ,val)  (write val) (newline))) => "bar" > (use-modules (ice-9 match)) > (match '(

Re: syntax taste: use of unquote in macros

2020-03-30 Thread Matt Wette
On 3/30/20 3:34 AM, to...@tuxteam.de wrote: On Mon, Mar 30, 2020 at 12:07:07AM +0200, Zelphir Kaltstahl wrote: On 3/29/20 5:11 PM, Matt Wette wrote: Hi All, I'm not sure if you know about this, but there is a discrepancy in the way some folks define macros to use unquote (aka ,). 

Re: How best to produce a standalone executable with Guile?

2020-04-05 Thread Matt Wette
On 4/4/20 10:28 PM, James Cooper wrote: Hi Guile folks, I am currently experimenting with a handful of languages that include modern implementations of Concurrent ML, to determine which one appears best able to handle computationally- and message-heavy workloads (at least for my purposes, Comput

[ANN] nyacc 1.02.0 released

2020-04-08 Thread Matt Wette
Hi All, I have released version 1.02.0 of NYACC. This release reflects a lot of work on the C99 munger, the constant expression evaluator, and the FFI helper. The munger does things like expanding use of C typedefs. This helps in being able to evaluate C expressions like sizeof(foo_t) where fo

Re: [ANN] nyacc 1.02.0 released

2020-04-10 Thread Matt Wette
On 4/8/20 6:27 AM, Matt Wette wrote: Hi All, I have released version 1.02.0 of NYACC. version 1.02.1 is released to fix a critical bug cxeval.scm(sizeof-mtail) where code to skip comments in struct and union def's was actually skipping the good code and trying to find size of comments. 

[ANN] nyacc-next.scm Guix package spec

2020-04-24 Thread Matt Wette
Hi All, I wanted to let you know the Guix pacakge spec for the latest NYACC release is available from https://download.savannah.gnu.org/releases/nyacc/nyacc-next.scm Examples will appear installed under $HOME/.guix-profile/share/doc/nyacc/examples/ About NYACC: https://www.nongnu.org/nyac

Re: FFI questions

2020-05-15 Thread Matt Wette
On 5/15/20 1:09 PM, Taylan Kammer wrote: The FFI Helper is by Matt Wette who also hangs around on this mailing list I believe. I think Taylan's suggestion on your first part is probably correct. Bytestructures allows you to access and change structure members by name. Matt

Re: FFI questions

2020-05-15 Thread Matt Wette
On 5/15/20 4:52 PM, Matt Wette wrote: On 5/15/20 1:09 PM, Taylan Kammer wrote: The FFI Helper is by Matt Wette who also hangs around on this mailing list I believe. I think Taylan's suggestion on your first part is probably correct. Bytestructures allows you to access and c

Re: Running guile single-threaded?

2020-05-17 Thread Matt Wette
On 5/17/20 8:27 AM, Caleb Ristvedt wrote: I'm trying to use unshare() with the CLONE_NEWUSER flag, but this requires that the process be single-threaded (otherwise I always get EINVAL). /proc//task has 6 entries when I launch guile, 5 after disabling automatic finalization. I can't seem to find a

Re: C programs in Scheme syntax

2020-05-29 Thread Matt Wette
The other solutions look closer to what you want but     https://savannah.nongnu.org/projects/nyacc has a C parser written in Guile which outputs SXML and a pretty-printer which converts the SXML to C code. On 5/28/20 8:23 PM, Keith Wright wrote: I am thinkging about a project that uses Scheme

Re: NYACC: getting source location info?

2020-07-10 Thread Matt Wette
On 7/10/20 1:37 PM, to...@tuxteam.de wrote: Hi, I'm having some fun with NYACC (thanks, Matt!). To help debugging things and for errors and warnings, it'd be nice to "know" where the current LHS non-terminal starts in the source. Its endpoint is (is it?) (port-line (current-input-port) [and

Re: Nyacc question: where are the actions bound?

2020-07-30 Thread Matt Wette
On 3/8/20 3:14 AM, to...@tuxteam.de wrote: Hi, I'm playing around with Nyacc: I found a first little use case to get my feet wet. First of all, than you, Matt, for this impressive package. Shamelessly stolen from the minimal example, playground looks roughly like this: #+begin_source scheme

Re: Nyacc question: where are the actions bound?

2020-08-03 Thread Matt Wette
On 8/3/20 1:42 PM, to...@tuxteam.de wrote: On Thu, Jul 30, 2020 at 06:50:08AM -0700, Matt Wette wrote: On 3/8/20 3:14 AM, to...@tuxteam.de wrote: Hi, I'm playing around with Nyacc: I found a first little use case [...] So I defined some function =collect= which will be called from ac

Re: define-language

2020-08-07 Thread Matt Wette
On 8/7/20 12:31 PM, Stephen Scheck wrote: What is the right way to use `define-language`? The Guile manual says that when using this form "the language will be added to the global language set." I interpret that to mean that the `,language` meta-command switches the REPL to use the newly-defined

Re: define-language

2020-08-07 Thread Matt Wette
On 8/7/20 12:31 PM, Stephen Scheck wrote: What is the right way to use `define-language`? The Guile manual says that when using this form "the language will be added to the global language set." I interpret that to mean that the `,language` meta-command switches the REPL to use the newly-defin

Re: Multi-language scripts

2020-08-21 Thread Matt Wette
On 8/21/20 11:22 AM, Stephen Scheck wrote: I'm trying to invoke `guile -s script` where script contains something like this: ,language ecmascript display("Hello JavaScript!\n"); ,language scheme (display "Hello Guile!\n") However, REPL meta-commands do not seem to be avai

Re: Multi-language scripts

2020-08-21 Thread Matt Wette
On 8/21/20 12:17 PM, Stephen Scheck wrote: Matt Wette wrote: Did you try `guile --language=emacscript’? mwette$ cat zz.js display("hello\n”); mwette$ guile --language=ecmascript zz.js hello The intent is that I want it to change language in the middle of the script. maybe this?

Re: Multi-language scripts

2020-08-22 Thread Matt Wette
On 8/22/20 7:53 AM, Stephen Scheck wrote: Matt Wette wrote: maybe this? (use-modules (system base language)) (current-language (lookup-language 'ecmascript)) It doesn’t work: scheme@(guile-user)> (use-modules (system base language)) scheme@(guile-user)> (look

Re: get absolute path of given path

2020-09-06 Thread Matt Wette
On 9/6/20 8:04 AM, Zelphir Kaltstahl wrote: Hi Guile Users! In my explorations into making examples for web development, I came across the question of how to get an absolute path from any given path. This is useful for example when checking, whether a path points to something inside a static a

Re: Starting a GNU Guile awesome list

2020-10-10 Thread Matt Wette
On 10/10/20 5:31 AM, Zelphir Kaltstahl wrote: #!/usr/bin/make -f SHELL := emacs .SHELLFLAGS := --quick --batch --eval Maybe try this:     #!/usr/bin/make -f - with the added dash.

[ANN] nyacc v 1.03.1 released

2020-10-20 Thread Matt Wette
Hi All, I have released nyacc-1.03.1.   Enjoy. Matt NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers.  It also provides sample parsers and pretty-printers using SXML trees as an intermediate representation. It provides a decent

Re: run compiled (*.go) file from command line?

2020-11-17 Thread Matt Wette
On 11/17/20 4:08 PM, Tim Meehan wrote: Is it possible to run a compiled file from the command line with "guile"? I'm assuming that it was compiled with something like: guild compile --output=whatever.go whatever.scm Or is it possible to just make an executable file out of "whatever.scm"? Thx

Re: getting to know the FFI ...

2020-11-22 Thread Matt Wette
On 11/19/20 7:02 PM, Tim Meehan wrote: I figured that I would try and do something simple-ish to see how well I understood the FFI. I found this GTK tutorial, written in Chez Scheme: https://github.com/jhidding/lyonesse/blob/master/gtk-tutorial/window.scm I just tried to replace the Chez FFI c

Re: Guile dynamic FFI, C function expecting pointer

2020-11-22 Thread Matt Wette
On 11/22/20 2:50 PM, Tim Meehan wrote: I tried to boil this question down to the most simple thing that represented what I needed to understand. I have had luck getting C functions that expect arguments "by value," but "by reference" has been problematic. The failure mode is "Segmentation Fau

SXML example showing diff between node-reduce and node-join

2021-01-11 Thread Matt Wette
Hi All, I'm going through the (sxml xpath) low-level routines to try to get a solid understanding of what they do. I just can't come up with an example to show how node-reduce and node-join differ. If someone could provide such an example I would really appreciate it. Takers? My end goal is

no scm_foreign_object_p ?

2021-01-23 Thread Matt Wette
I started using foreign objects but want something akin to number?, string? etc. Is there something that works here? I was hoping to see scm_foreign_object_p(type, object).

Re: no scm_foreign_object_p ?

2021-01-23 Thread Matt Wette
On 1/23/21 12:04 PM, divoplade wrote: Hello, Le samedi 23 janvier 2021 à 14:29 -0500, olivier.dion--- via General Guile related discussions a écrit : On Sat, 23 Jan 2021, Matt Wette wrote: I started using foreign objects but want something akin to number?, string? etc. Is there something

csv module site?

2021-01-27 Thread Matt Wette
Hi All, Where is csv.scm maintained these days?  I'm running into a bug or feature where a line with only separators has N-1 entries where I'm expecting N. Example. abc 123 gives (#("a" "b" "c") #("1" "2" "3") #("" "")) Matt

Re: Guile + SWIG

2021-04-05 Thread Matt Wette
When scripts with load-extension are compiled, the compiler does not know what symbols are defined in the extension so you may get warnings. Are you getting an error or just the warning? On 4/5/21 10:44 AM, Paul Emsley wrote: Hi Linas, Thanks for your reply. Let me clarify if I can. I have man

Re: Lepton EDA 1.9.14 announce and misc questions

2021-04-20 Thread Matt Wette
On 4/20/21 2:29 AM, Vladimir Zhbanov wrote: Hi Guile users and devs, I'm the current maintainer of Lepton EDA suite, an about five year old fork of geda-gaf with accent to moving more functionality to Scheme code. I'm not sure if it is acceptable to advertise it here, please let me know if n

Re: Lepton EDA 1.9.14 announce and misc questions

2021-04-20 Thread Matt Wette
On 4/20/21 5:47 AM, Matt Wette wrote: On 4/20/21 2:29 AM, Vladimir Zhbanov wrote: Hi Guile users and devs, I'm the current maintainer of Lepton EDA suite, an about five year old fork of geda-gaf with accent to moving more functionality to Scheme code.  I'm not sure if it is acc

Re: Lepton EDA 1.9.14 announce and misc questions

2021-04-20 Thread Matt Wette
On 4/20/21 4:36 PM, Vladimir Zhbanov wrote: Hi Matt, On Tue, Apr 20, 2021 at 06:46:27AM -0700, Matt Wette wrote: On 4/20/21 5:47 AM, Matt Wette wrote: On 4/20/21 2:29 AM, Vladimir Zhbanov wrote: Hi Guile users and devs, I'm the current maintainer of Lepton EDA suite, an about five

excpetion printing

2021-04-20 Thread Matt Wette
Is there any error I can throw in Guile that I don't catch myself but will result in a user-friendly error message at the top?  Not this: Throw to key `misc' with args `("read-yaml-file" "file not found: ~S" ("demo1x.yml") #f)'.

Re: excpetion printing

2021-04-20 Thread Matt Wette
On 4/20/21 5:43 PM, Matt Wette wrote: Is there any error I can throw in Guile that I don't catch myself but will result in a user-friendly error message at the top?  Not this: Throw to key `misc' with args `("read-yaml-file" "file not found: ~S" ("de

Re: Python-on-guile

2021-04-23 Thread Matt Wette
On 4/23/21 8:00 AM, Mikael Djurfeldt wrote: Hi, Yesterday, Andy committed new code to the compiler, some of which concerned skipping some arity checking. Also, Stefan meanwhile committed something called "reworked object system" to his python-on-guile. Sorry for coming with unspecific informat

Re: [ANN] GNU Guile State Machine Compiler (Guile-SMC)

2021-04-25 Thread Matt Wette
On 4/24/21 11:43 AM, Artyom V. Poptsov wrote: Hello Guilers! I heard some of you like finite state machines. If you love FSM as much as I do, you may want to take a look on my Guile state machine compiler (Guile-SMC): https://github.com/artyom-poptsov/guile-smc With Guile-SMC, you can gen

Re: [ANN] Guile-DRMAA 0.1.0

2021-04-28 Thread Matt Wette
On 4/28/21 2:39 AM, Ricardo Wurmus wrote: Hi there, I’m writing this to unceremoniously announce the first release (0.1.0) of Guile DRMAA.  Guile DRMAA provides Guile bindings to version 1 of the DRMAA library, a library to interact with different HPC schedulers.  It uses Matt Wette’s most

Re: Python's pdb module

2021-04-30 Thread Matt Wette
On 4/29/21 8:26 PM, Tim Meehan wrote: Is there something in Guile that is similar to Python's "pdb" module? For instance, sometimes I find it helpful to pause right before something bad happens with: #!/usr/bin/env python3 import pdb; pdb.set_trace() some_function_that_is_going_to_fail_miserab

[ANN] nyacc-1.03.7 released

2021-05-23 Thread Matt Wette
This is a quick release of nyacc 1.03.7 to fix a bug introduced in 1.03.5 that would stop constant definitions from being emitted in the symbol dict. NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers.  It also provides sample parser

[ANN] nyacc 1.04.0 released

2021-05-28 Thread Matt Wette
Hi All, I have released nyacc-1.04.0, which provides union support in the FFI Helper. I have not thoroughly tested (as FFI Helper tests are not yet automated). Also, I have been uploading a guix.scm file in the release directory. I have not been using guix lately so any feedback to clean it up w

#guile libera.chat

2021-05-29 Thread Matt Wette
Hi All, I gather there a move afoot from freenode to libera. I'd appreciate is someone who has moved sucessfully could post help here. In emacs I have a function set to execute  (erc :server "irc.libera.chat" :port "6667"     :nick "mwette") and (setq erc-autojoin-channels-alist '(("libera.ch

Re: #guile libera.chat

2021-05-29 Thread Matt Wette
Thanks.   Now I did REGISTER but had typo in my email address. I'm not sure I can recover from that.  I may need a new nick, right? On 5/29/21 10:10 AM, dsm...@roadrunner.com wrote: Greetings Matt, You also must register your nick with nickserv before you can speak in the channel. -Dale

[ANN] nyacc 1.04.1 released

2021-05-30 Thread Matt Wette
fixed bus 60697 and 60684 NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers. It also provides sample parsers and pretty-printers using SXML trees as an intermediate representation. It provides a decent C parser and a `FFI Helper'

Re: Guile 3.0.7 compile cache messages

2021-06-02 Thread Matt Wette
I believe there was an issue on one of the releases where a shared object library was misnamed.  Check the installed .so's. I'd try deleting your cache (~/.cache/guile/...) and checking your environment variables.   It looks to me like maybe Guile is checking in one place and installing in anot

[ANN] nyacc 1.05.0 released

2021-09-05 Thread Matt Wette
NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for generating parsers and lexical analyzers. It also provides sample parsers and pretty-printers using SXML trees as an intermediate representation. It provides a decent C parser and a `FFI Helper' tool to help create Guile

Re: Trouble creating SRFI-9 Record in C

2021-09-11 Thread Matt Wette
maybe add (define (make-foo-x a b) (make-foo a b)) then call make-foo-x (or reverse names) On 9/10/21 7:27 PM, paul wrote: Good day guile-users, I am having a struggle with SRFI-9 records.  They look very convenient, so i'd like to use them in my Guile scripts.  However, i'm not sure how to

Re: backing out of debugger

2021-09-15 Thread Matt Wette
On 9/14/21 5:50 AM, Mortimer Cladwell wrote: Hi, Let's say I made a lot of mistakes. I look at my repl and see: scheme@(guile-user) [10]> Any way to back out to scheme@(guile-user)> without typing ,q ten times? Thanks Mortimer Try binding a command to: (while (pair? (cdr (fluid-ref *repl-sta

Re: backing out of debugger

2021-09-15 Thread Matt Wette
On 9/15/21 5:49 AM, Matt Wette wrote: On 9/14/21 5:50 AM, Mortimer Cladwell wrote: Hi, Let's say I made a lot of mistakes. I look at my repl and see: scheme@(guile-user) [10]> Any way to back out to scheme@(guile-user)> without typing ,q ten times? Thanks Mortimer Try binding a

  1   2   3   4   5   >