Re: UTF16 encoding adds BOM everywhere?

2022-07-20 Thread Mark H Weaver
Hi, Jean Abou Samra wrote: > With this code: > > (let ((p (open-output-file "x.txt"))) >   (set-port-encoding! p "UTF16") >   (display "ABC" p) >   (close-port p)) > > the sequence of bytes in the output file x.txt is > > ['FF', 'FE', '41', '0', 'FF', 'FE', '42', '0', 'FF', 'FE', '43',

Re: Weird behavior of hash-table

2019-11-24 Thread Mark H Weaver
Hi tomás, wrote: > So the best thing for one's brain is to train it to read #(...) > as some weird relative of '(...)? Yes. They are both literals, and no part of a literal is evaluated. #(...) is actually a shorthand for '#(...), and incidentally, one which was not standardized until the

Re: Weird behavior of hash-table

2019-11-24 Thread Mark H Weaver
Hi Zelphir, Zelphir Kaltstahl writes: > I've noticed a strange behavior of hash tables. I put in symbols as keys > and integers as values, but when I try to get the integers out again by > using the same symbol, I get back a #f instead. Here is the code I am using: > > > (use-modules >

Re: guile-json, SRIFs and licenses

2019-11-09 Thread Mark H Weaver
Hi John, John Cowan writes: > [...] There are two traditional arguments > in favor of putting libraries under the GPL: [...] > 2) "Benefit GPLed programs": if a library is GPLed, it supposedly gives > the advantages of using that library only to GPLed applications. You're mistaken. A

Re: guile-user Digest, Vol 204, Issue 2

2019-11-08 Thread Mark H Weaver
John Cowan wrote: > Dual licensing is also a possibility, so that users who prefer the GPLv3 > license would still have it. Dual licensing with a lax license option would eliminate the main advantage of copyleft, namely that it offers an inducement to those who wish to use Guile-JSON to release

Re: guile-user Digest, Vol 204, Issue 2

2019-11-08 Thread Mark H Weaver
Hi John, John Cowan writes: > Distinguo. I have not *pressured* the author to dual license; that is, I > have not exercised force or undue influence (of which I have none). According to , "pressure" means: "To encourage or heavily exert force or

Re: guile-user Digest, Vol 204, Issue 2

2019-11-08 Thread Mark H Weaver
Hi Aleix, Aleix Conchillo Flaqué wrote: > If at some point I decide to switch to the MIT license I assume > the projects that currently use guile-json would still be able to use it > (probably renamed to some SRFI number) the same way they use other SRFIs, > right? Yes, as long as it's

Re: guile-user Digest, Vol 204, Issue 2

2019-11-08 Thread Mark H Weaver
I wrote: > Zelphir could propose a SRFI for the API only, with no reference > implementation. The existing implementation could remain copylefted. John Cowan replied: > Unfortunately not. A SRFI must have a sample implementation to get > finalized (otherwise it is feared there would be too

Re: guile-user Digest, Vol 204, Issue 2

2019-11-08 Thread Mark H Weaver
John Cowan writes: > +1. If only it weren't GPL3, which makes it ineligible to be a SRFI > implementation Zelphir could propose a SRFI for the API only, with no reference implementation. The existing implementation could remain copylefted. Mark

Re: Diversification [ branched from Re: conflicts in the gnu project now affect guile]

2019-10-22 Thread Mark H Weaver
Hi Todor, Todor Kondić writes: > [...] I've set up my workflows around Guix, git(lab) > and a customised Emacs installation (instead of R Studio). My small > team of science students (majority female, various cultural > backgrounds), never previously exposed to a GNU system to such an >

Re: Interactive Debugging

2019-10-18 Thread Mark H Weaver
"Thompson, David" writes: > On Fri, Oct 18, 2019 at 8:40 AM Matt Wette wrote: >> >> 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))

Re: Stepping back up as a co-maintainer

2019-10-18 Thread Mark H Weaver
zx spectrumgomas writes: > Of your words: “RMS has not yet appointed me as a co-maintainer.” , the > word “yet” I guess that means if he would have had his permission then you > wouldn't have needed it of the current maintainers, as I also deduce from > here: > “Frankly, it should not be your

Re: Stepping back up as a co-maintainer

2019-10-18 Thread Mark H Weaver
zx spectrumgomas writes: > It's milk > https://lists.gnu.org/archive/html/guile-devel/2019-10/msg00031.html I'm sorry, but I don't understand what this means. If you are accusing me of something, can you state your case clearly, without reference to proverbs? Mark

Re: Weird Guile Scheme Behaviour

2019-10-16 Thread Mark H Weaver
Hi Philip, phi...@warpmail.net (Philip K.) writes: > I was reading a thread on an imageboard[0] the other day, then I came > across a most peculiar "bug", if it even is one. Since the original > example was a bit dense (it tried to solve a problem someone else had > posted, that's not relevant

Stepping back up as a co-maintainer

2019-10-15 Thread Mark H Weaver
Hello all, In light of recent events, I've decided to step back up as a co-maintainer of GNU Guile. Thanks, Mark

Re: How to use-modules within macro?

2019-09-04 Thread Mark H Weaver
Hello again, I wrote earlier: > So, instead of using 'match' on the result of 'syntax->datum', you > should instead use 'syntax-case' on the syntax object itself, like this > (untested): > > (let loop ((e #'exp)) > (syntax-case e () > (num >(number? (syntax->datum #'num)) >

Re: extract documentation from (define ...

2019-09-04 Thread Mark H Weaver
Hi Jesse, Jesse Gibbons writes: > I am trying to generate documentation for a project written in guile. I > tried "guild doc-snarf" [0] but apparently it only recognizes > documentation in double-semicolon comments. A lot of the project is > documented in a string like one would document an

Re: How to use-modules within macro?

2019-09-04 Thread Mark H Weaver
Hi Florian, "pelzflorian (Florian Pelz)" writes: > To retain unhygienic references, I am now using datum->syntax instead > of local-eval. It is much better. For example, to make a macro that > increments all numbers in a given program by one: > > (use-modules (ice-9 match)) > (define-syntax

Re: How to use-modules within macro?

2019-08-29 Thread Mark H Weaver
Hi Florian, "pelzflorian (Florian Pelz)" writes: > I am writing a Guile macro to manipulate Scheme code and am stuck on > what I hope is a simple problem and it would be nice if you could > explain. I try: > > (define-syntax O > (lambda (x) > (syntax-case x () > ((_) >

Re: Problem installing the intended version

2019-08-10 Thread Mark H Weaver
Hi Thomas, Thomas Morley writes: > In the light of your explanations I think the current problem only > occurs for _equal_ major/minor with _different_ micro versions. > Correct? Yes. >> and finally "ldconfig" as root. > > Doing so I get: > /sbin/ldconfig.real:

Re: Problem installing the intended version

2019-08-09 Thread Mark H Weaver
Hi Thomas, Thomas Morley writes: > recently I tested building LilyPond against guile-2.2.6 without > success[*] and tried to investigate whether the problem is on the > guile-side or at LilyPond (there are some patches which may or may not > cause the problem). > > Though I stumbled across a

Re: yet another Guile tutorial for Linux (work in progress)

2019-08-07 Thread Mark H Weaver
Hi Basile, Basile Starynkevitch writes: > I am writing yet another Guile tutorial. It is work in progress and > available on http://starynkevitch.net/Basile/guile-tutorial-1.html > under CC-BY-SA 3 license. > > Your comments are welcome. Thanks for this. I will try to find time to review it

Re: syntax-case identifier name predicate in guard expression

2019-08-05 Thread Mark H Weaver
Hi Zelphir, Zelphir Kaltstahl writes: > Hi Guile Users! > > I made some progress in writing a procedure defining macro for creating > procedures which talk to an API. > > I now have working code, which checks the name of an identifier in a > guard expression: > > 8<8<8< >

Re: Write a macro which defines a procedure

2019-07-20 Thread Mark H Weaver
Hi Zelphir, Zelphir Kaltstahl writes: > At first I had the macro use `define`, but then I thought: "What if I > want to conditionally define a route procedure?". My guess is, that then > the define form would be inside some `cond` or `if` form and then it > would not work You're right, it

Re: Write a macro which defines a procedure

2019-07-20 Thread Mark H Weaver
Matt Wette writes: > On 7/19/19 3:51 PM, zelphirkaltstahl wrote: >> (module-define! (current-module) >> ;; `route` should be `/container/json` for example. >> route > > (quote route) Yes, or equivalently: 'route As an aside, is there a reason to not

Re: Now crashing [was Re: guile-2.9.2 and threading

2019-07-17 Thread Mark H Weaver
Hi Linas, > Investigating the crash with good-old printf's in libguile/vm.c produces > a vast ocean of prints ... that should have not been printed, and/or should > have been actual errors, but somehow were not handled by scm_error. > Using today's git pull of master, here's the diff containing a

Re: Threading / Pipe Macro

2019-07-07 Thread Mark H Weaver
Hello again, Chris Vine writes: > My version was hygienic when used in functions, but not when used as a > macro in a macro. Not to belabor the point, but I wanted to mention that the unhygienic '->' macro may fail when used in procedures, even when '->' is never used in the definition of

Re: Threading / Pipe Macro

2019-07-07 Thread Mark H Weaver
Hi Chris, Chris Vine writes: > My version was hygienic when used in functions, but not when used as a > macro in a macro. The word "hygienic" should not be used to describe your original macro. It would be more accurate to say that although your original version was unhygienic, in practice it

Re: Threading / Pipe Macro

2019-07-07 Thread Mark H Weaver
Hi Chris, Here's a complete, unedited transcript with Guile 2.2.6: --8<---cut here---start->8--- mhw@jojen ~$ guile GNU Guile 2.2.6 Copyright (C) 1995-2019 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.

Re: Threading / Pipe Macro

2019-07-07 Thread Mark H Weaver
Hi Chris, Chris Vine writes: > I have a pipeline macro which sort-of mimics ML's |> pipeline operator > which I use a lot: > > (define-syntax -> > (lambda (x) > (syntax-case x () > [(k exp0 . exps) >(let* ([reversed (reverse (cons (syntax->datum #'exp0) >

Re: Self-evaluating function and closure

2019-06-17 Thread Mark H Weaver
Hi Vladimir, Vladimir Zhbanov writes: > Great, I've adapted your example to our code and it works > nice. Thank you very much! You're welcome, and I'm glad to hear it :) Best, Mark

Re: [ANN] guile-gi 0.0.2 released

2019-06-16 Thread Mark H Weaver
Mike Gran writes: > In short, this library hopes to make GTK3 and WebKit2 available to > Guile. > > This particular library is one of several different attempts and > solving the interface between GTK+3 and Guile. Its differentiating > (mis)feature is that its bindings are created dynamically

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

2019-06-16 Thread Mark H Weaver
Hi John, John Cowan writes: > On Sun, Jun 16, 2019 at 2:47 AM Mark H Weaver wrote: > > >> How do you implement 'written-shared', 'pretty-shared', and >> 'trimmed/lazy'? In particular, how do you avoid non-termination when >> asked to print cyclic data, when the cy

Re: Self-evaluating function and closure

2019-06-16 Thread Mark H Weaver
Hello again, Vladimir Zhbanov writes: > scheme@(guile-user)> (define (function-generator) >(let ((func #f)) > (lambda () (set! func (let a () a)) func))) [...] > - Is there a way to work around this (either using the

Re: Self-evaluating function and closure

2019-06-16 Thread Mark H Weaver
Hi Thomas, Thomas Morley writes: > always interested in guile developments with regard to lilypond I > noticed some inconsistence with my local lilypond-using-guile-2.9.2 > installation. > I think I could break it down to pure guile (no lilypond) > > (1) The already stated behaviour: > ~$ guile

Re: Self-evaluating function and closure

2019-06-16 Thread Mark H Weaver
Hi Vladimir, Vladimir Zhbanov writes: > On Sat, Jun 15, 2019 at 08:36:34PM -0400, Mark H Weaver wrote: >> Vladimir Zhbanov writes: >> >> > I have tried almost a textbook example with Guile 2.2.4: >> > >> > scheme@(guile-user)> (define (functio

Re: Self-evaluating function and closure

2019-06-16 Thread Mark H Weaver
Hello again Vladimir, Vladimir Zhbanov writes: > - Is there a way to work around this (either using the above 'let' > construct or anything else)? I'm not quite sure how to answer this question because I don't know what your requirements are. If you need to generate unique tags, any mutable

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

2019-06-16 Thread Mark H Weaver
Hi Linus, Linus Björnstam writes: > I am not sure I understand what you mean, but i suspect it is already > solved, since for simple cases show will use display/write. So unless > you try to do advanced formatting of circular lists it will do > whatever display or write does. The same thing

Re: Self-evaluating function and closure

2019-06-15 Thread Mark H Weaver
Hi Vladimir, Vladimir Zhbanov writes: > Greetings, > > I have tried almost a textbook example with Guile 2.2.4: > > scheme@(guile-user)> (define (function-generator) >(let ((func #f)) > (lambda () (set! func (let a () a))

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

2019-06-11 Thread Mark H Weaver
Hi Linus, Linus Björnstam writes: > I just ported the reference implementation of SRFI-159/166 (166 being > the successor of 159) from the reference implementation in chibi > scheme. The srfi document is here: > https://srfi.schemers.org/srfi-166/srfi-166.html > > SRFI-166 is like (ice-9

Re: guile-2.9.2 and threading

2019-06-06 Thread Mark H Weaver
Mark H Weaver writes: >> Two are stuck here: >> >> #0 __lll_lock_wait () at >> ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135 >> #1 0x7f343ca69bb5 in __GI___pthread_mutex_lock ( >> mutex=mutex@entry=0x7f343d4f0f40 ) >>

Re: guile-2.9.2 and threading

2019-06-06 Thread Mark H Weaver
Hi Linas, Linas Vepstas writes: > I'm trying to understand how scm_jit_enter_mcode leads to > scm_timed_lock_mutex ... This simply means that 'lock-mutex' was called from Scheme, and specifically from Scheme code that has been compiled to machine code by our JIT compiler. > I want to know who

Re: TeXmacs on Guile 2.2.4

2019-05-29 Thread Mark H Weaver
Massimiliano Gubinelli writes: > While trying some alternative solutions I noticed the following: the > function scm_to_latin1_stringn calls out to scm_to_stringn with an > argument NULL for the encoding: > > result = scm_to_stringn (str, lenp, NULL, >

Re: string-ports issue on Windows

2019-05-26 Thread Mark H Weaver
Hi Christopher, Christopher Lam writes: > Addendum - wish to confirm if guile bug (guile-2.2 on Windows): > - set locale to non-Anglo so that (setlocale LC_ALL) returns > "French_France.1252" > - call (strftime "%B" 400) - that's 4x10^6 -- this should return > "février 1970" > > but the

Re: Are there any way to mimic Bash's exit traps in Guile?

2019-05-25 Thread Mark H Weaver
Hello again, Mark H Weaver writes: > Михаил Бахтерев writes: > >> I use in one of my bash-scripts the following construction >> >> trap "kill -s TERM 0" EXIT In my earlier reply, I somehow failed to notice that you're killing the entire process group by p

Re: Are there any way to mimic Bash's exit traps in Guile?

2019-05-25 Thread Mark H Weaver
Hi, Михаил Бахтерев writes: > I use in one of my bash-scripts the following construction > > trap "kill -s TERM 0" EXIT > > to terminate all spawned processes when master process exits or is > aborted by any reason. Is equivalent technique possible in Guile? Guile doesn't provide anything

Re: exporting GOOPS generic functions, was: [ANN] guile-file-names 0.2

2019-05-24 Thread Mark H Weaver
Hello again, > Brandon Invergo writes: > >> I can try something like this: >> >> (let ((old-absolute-file-name? absolute-file-name?)) >> (define-generic absolute-file-name?) >> (define-method (absolute-file-name? (f )) >> (proper-list? (route f))) >> (define-method

Re: exporting GOOPS generic functions, was: [ANN] guile-file-names 0.2

2019-05-24 Thread Mark H Weaver
Hi Brandon, Brandon Invergo writes: > I can try something like this: > > (let ((old-absolute-file-name? absolute-file-name?)) > (define-generic absolute-file-name?) > (define-method (absolute-file-name? (f )) > (proper-list? (route f))) > (define-method

Re: [ANN] guile-file-names 0.2

2019-05-16 Thread Mark H Weaver
Hi again, I wrote: > If you must override core procedures, then please use #:export and > #:replace in the 'define-module' form, and simply 'define' the new > binding in your module instead of using 'set!'. That way, the bindings > in (guile) will be left unchanged, and your new bindings will

Re: [ANN] guile-file-names 0.2

2019-05-16 Thread Mark H Weaver
Hi Brandon, Brandon Invergo writes: > I'm happy to announce the release of guile-file-names 0.2. > > The (file-names) module provides methods for manipulating file names. > Its design distinguishes between the human-friendly string format of > filenames ("/usr/bin/guile") and a more

Re: Guile assert macro

2019-04-22 Thread Mark H Weaver
Hi Zelphir, Zelphir Kaltstahl writes: > I was looking for an assert facility in Guile and found the following: > > https://www.gnu.org/software/guile/manual/html_node/rnrs-base.html#rnrs-base > > (Search for assert there to find it on the page.) > > However, while searching, I also found

Re: string-ports issue on Windows

2019-04-18 Thread Mark H Weaver
Hi again, Earlier, I wrote: > Christopher Lam writes: > >> Hi Mark >> Thank you so much for looking into this. >> I'm reviewing the GnuCash for Windows package (v3.5 released April 2019) >> which contains the following libraries: >> - guile 2.0.14 > > Ah, for some reason I thought you were

Re: string-ports issue on Windows

2019-04-18 Thread Mark H Weaver
Hi Christopher, Christopher Lam writes: > Hi Mark > Thank you so much for looking into this. > I'm reviewing the GnuCash for Windows package (v3.5 released April 2019) > which contains the following libraries: > - guile 2.0.14 Ah, for some reason I thought you were using Guile 2.2. That

Re: A problem with statprof

2019-04-17 Thread Mark H Weaver
Hi, Tommi Höynälänmaa writes: > It seems that statprof gives some second counts in some other units > than seconds. I'm using guile 2.9.1. Consider the following program: > > ---cut here--- > (import (statprof)) > > (define (factorial n) >   (if (= n 0) 1 (* n (factorial (- n 1) > > (define

Re: Continuations in custom port: "cannot invoke continuation from this context"

2019-04-17 Thread Mark H Weaver
Hi Caleb, Earlier I wrote: > Caleb Ristvedt writes: > >> On Thu, Mar 28, 2019 at 12:58 PM Stefan Israelsson Tampe < >> stefan.ita...@gmail.com> wrote: >> >>> I have not looked at this more carefully. But I suspect that the code is >>> going to C land and then enters the scheme again >>> via the

Re: string-ports issue on Windows

2019-04-16 Thread Mark H Weaver
Hi Christopher, Christopher Lam writes: > I'm struggling with string-ports on Windows. > > Last para of > https://www.gnu.org/software/guile/manual/html_node/String-Ports.html > "With string ports, the port-encoding is treated differently than other > types of ports. When string ports are

Re: string-ports issue on Windows

2019-04-16 Thread Mark H Weaver
Hi, Eli Zaretskii writes: >> From: Christopher Lam >> Date: Tue, 16 Apr 2019 04:13:14 + >> >> I'm struggling with string-ports on Windows. > > Which version of Guile are you using, and where/how did you obtain the > Windows binary? > >> Last para of >>

Re: Continuations in custom port: "cannot invoke continuation from this context"

2019-04-01 Thread Mark H Weaver
Hi Caleb, Caleb Ristvedt writes: > On Thu, Mar 28, 2019 at 12:58 PM Stefan Israelsson Tampe < > stefan.ita...@gmail.com> wrote: > >> I have not looked at this more carefully. But I suspect that the code is >> going to C land and then enters the scheme again >> via the hooks and then

Re: Unicode numeric value

2018-12-17 Thread Mark H Weaver
Mark H Weaver writes: > If the range of relevant code points is small enough, another approach > would be to use a vector: > > (define private-code-point-start #xE000) > (define private-code-point-end #xF900) > > (define (code-point-in-range? cp) > (<

Re: Unicode numeric value

2018-12-17 Thread Mark H Weaver
Hi, Freeman Gilmore writes: > On Sun, Dec 16, 2018 at 3:15 AM Mark H Weaver wrote: > > Freeman Gilmore writes: > > > I am looking for a procedure that will read the numeric value, field 8, of > > an Unicode numeric character. Has anyone written this procedure

Re: Unicode numeric value

2018-12-16 Thread Mark H Weaver
Freeman Gilmore writes: > I am looking for a procedure that will read the numeric value, field 8, of > an Unicode numeric character. Has anyone written this procedure or know > where I can find it? The 'r7rs-wip' branch of the Guile git repository contains a procedure that does this, with a

Re: a network client

2018-12-13 Thread Mark H Weaver
Hi, Catonano writes: > I wrote a small server in Guile scheme > > I used the command "nc" to test it > > It seems to work > > Then I wrote a small client in Guile > > It doesn't work and I don't understand why I'm sorry, but there's not enough information in your email for me to understand

Re: Need help with macro

2018-12-12 Thread Mark H Weaver
Hi Mike, Mike Gran writes: > Hey all, > > I need help making a macro. > > I have an existing procedure of the form > > (call-method self method (...)) > > Note that SELF is a struct, METHOD is a string, and the ellipses can > be anything. > > I would like to make a macro that transforms into

Re: Guile 2.2.4 warnings

2018-12-02 Thread Mark H Weaver
Hi, Tommi Höynälänmaa writes: > I just installed Guile 2.2.4 to a chroot sid (Debian) > environment. Guile gives the following warnings on startup: > > ---cut here--- > > guile: warning: failed to install locale > warning: failed to install locale: Invalid argument > > ---cut here--- This

Re: How to build GNUTLS Guile bindings on Xubuntu

2018-11-17 Thread Mark H Weaver
Hi Alex, Alex Vong writes: > Btw, this bug report[0] > explains why the guile bindings were removed. Although it's mark as > wontfix, should we encourage the maintainers to re-enable the guile > bindings in the experimental repository? Based on:

Re: How to build GNUTLS Guile bindings on Xubuntu

2018-11-16 Thread Mark H Weaver
Hi Alex, Alex Vong writes: > Maybe what I wrote is not clear. What I mean is that since Debian build > of gnutls does not include the guile bindings, we have to build gnutls > from the source tarball ourselves. > > The flag "--with-guile-site-dir=/usr/local/share/guile/site/2.2" > instructs the

Re: How to build GNUTLS Guile bindings on Xubuntu

2018-11-16 Thread Mark H Weaver
Hi Alex, Alex Vong writes: > Zelphir Kaltstahl writes: > >> I took another look at the page you linked to. The issue is, that I >> would like to try Guix package manager to install GNUTLS + Guile >> bindings, but Guix itself has the requirement of GNUTLS + Guile >> bindings. See: >>

Re: How to build GNUTLS Guile bindings on Xubuntu

2018-11-15 Thread Mark H Weaver
Zelphir Kaltstahl writes: > I took another look at the page you linked to. The issue is, that I > would like to try Guix package manager to install GNUTLS + Guile > bindings, but Guix itself has the requirement of GNUTLS + Guile > bindings. See: >

Re: How to build GNUTLS Guile bindings on Xubuntu

2018-11-14 Thread Mark H Weaver
Hi Zelphir, Zelphir Kaltstahl writes: > I read in the docs at > https://www.gnu.org/software/guile/manual/html_node/Web-Client.html that > Guile will dynamically make use of GNUTLS for HTTPS requests. However, I > don't seem to have the bindings installed. There is a link to a guide on > the

Re: http-request procedure missing or not exported from web client

2018-11-13 Thread Mark H Weaver
Zelphir Kaltstahl writes: > I recently noticed, that the procedure ~http-request~ > (https://www.gnu.org/software/guile/manual/html_node/Web-Client.html) > does not seem to be available when I do: > > ~~~ > > (use-modules (web client)) > (http-request ...) > > ~~~ > > However, the specialised

Re: What's up with 'current-load-port'

2018-11-04 Thread Mark H Weaver
Thomas Morley writes: > what's up with 'current-load-port'? > > Simply checking in a guile-prompt I get: > guile-1.8: # > guile-2.0.14: # > guile-2.2.4 and guile-2.9.1: > ;;; : warning: possibly unbound variable `current-load-port' > ERROR: In procedure module-lookup: Unbound variable:

Re: Beginner questions

2018-10-30 Thread Mark H Weaver
Hi, swedebugia writes: > I would like to learn more scheme and I would like to make a small CLI > program that runs in the terminal and prompts the user for input and > evaluates it. This sounds like a description of Guile's REPL itself. Are you looking to implement your own simple REPL for

Re: A macro containing a mini-macro?

2018-09-28 Thread Mark H Weaver
I wrote: > It turns out that pure 'syntax-rules' macros are turing complete, but > they are limited in the ways that they can inspect the syntax objects > given to them as operands. In particular, they cannot inspect atomic > expressions, except to compare them with the finite set of literals in

Re: A macro containing a mini-macro?

2018-09-28 Thread Mark H Weaver
Hi, HiPhish writes: > Hello Schemers, > > I have written a small macro for writing test specifications: > > (define-syntax test-cases > (syntax-rules () > ((_ title >(given (byte byte* ...)) >...) > (begin >(test-begin title) >

Re: Comparing two hash tables for equality?

2018-08-28 Thread Mark H Weaver
Aleksandar Sandic writes: > I did not know about HAMTs, looks interesting. It's not relevant to my use- > case, but it's an interesting topic to look into. Thanks. There's an implementation of HAMTs that works with Guile in the following "Purely Functional Data Structures in Scheme" library:

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
Hi John, John Cowan writes: > On Tue, Aug 28, 2018 at 11:40 AM Mark H Weaver wrote: > > That's the phrase used in R7RS-small, which fails to define it, as you > noted, but that shortcoming is limited to R7RS. > > The relevant sentences in R5RS and R7RS are identical: &quo

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
John Cowan writes: > On Tue, Aug 28, 2018 at 11:40 AM Mark H Weaver wrote: > > That's the phrase used in R7RS-small, which fails to define it, as you > noted, but that shortcoming is limited to R7RS. > > The relevant sentences in R5RS and R7RS are identical: " If

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
Mark H Weaver writes: > John Cowan writes: > >> On Tue, Aug 28, 2018 at 3:01 AM Mark H Weaver wrote: >> >> In RnRS, (define a (if #f #f)) is allowed and guaranteed to assign >> *some* object to 'a' without signalling an error. >> >> Actually, the

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
John Cowan writes: > On Tue, Aug 28, 2018 at 3:01 AM Mark H Weaver wrote: > > In RnRS, (define a (if #f #f)) is allowed and guaranteed to assign > *some* object to 'a' without signalling an error. > > Actually, the phrase used is "the result is unspecifie

Re: Comparing two hash tables for equality?

2018-08-28 Thread Mark H Weaver
Hi Aleksandar, Aleksandar Sandic writes: >> An equality test on hash tables needs to know how to compare the keys >> and how to compare the values. There's no way to pass those additional >> arguments to 'equal?', so it can't do that job. > It has to compare the values, but not the keys.

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
Matt Wette writes: > Is it reasonable to expect that if a value can be assigned to a variable > then a predicate exists to test for that value type? So, if > > (define a (if #f #f)) > > does not signal an error then there should be a predicate to indicate the > value associated with a is

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
John Cowan writes: > However, in formats like JSON where map keys are always strings, > it can save a lot of space to represent them as symbols, since > they are often repeated from one object to the next. There is no such > limitation in MessagePack, although I bet strings are the most common >

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
John Cowan writes: > On Mon, Aug 27, 2018 at 12:54 AM Mark H Weaver wrote: > > However, in most cases, symbols are precisely what's needed to represent > distinguished atomic objects such as this. > > The problem with symbols in Scheme is that they are not namespaced,

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
I wrote: > If he would like people to be able to write code that uses his library > and works on multiple Scheme implementations, then it will certainly be > an impediment to use a Racket-specific value for Nil on Racket, and a > Guile-specific value for Nil on Guile. It would be much better to

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
writes: > On Sun, Aug 26, 2018 at 04:07:13PM -0400, Mark H Weaver wrote: > >> I would also avoid Guile's #nil. That is a very special value, for one >> purpose relating to Elisp compatibility, and ideally it should not be >> used for anything else. > > I must adm

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
l...@gnu.org (Ludovic Courtès) writes: > I would suggesting returning zero values, using: > > (values) > > That way, if a caller wrongfully attempts to get at the return value of > that procedure, it’ll get an error. > > Fibers does that in several places, and I think it’s a good convention >

Re: A value for "nothing"

2018-08-26 Thread Mark H Weaver
John Cowan writes: > Well, you could use #nil, a Guile-specific unique object that is both falsy > (like #f) and answers #t to the null? predicate. It is used to emulate > Common Lisp's and Elisp's nil. As I wrote earlier, I would avoid using #nil for anything outside of its intended use case.

Re: Comparing two hash tables for equality?

2018-08-26 Thread Mark H Weaver
Hi Aleksandar, Aleksandar Sandic writes: > I have been looking through the reference manual, but there does not seem to > be a procedure for comparing two hash tables for equality. The procedure > 'equal?' only returns true if the two tables are also 'eq?': > > scheme@(guile-user)>

Re: A value for "nothing"

2018-08-26 Thread Mark H Weaver
Hi, HiPhish writes: > I am writing an implementation of MessagePack [1] for Guile and a part of the > spec is the presence of a "nil" data type. What would be a good value to > express "nothing" in Guile? First of all, thank you very much for asking the question. I often wish that authors

Re: Change interpreter from octets to hex?

2018-08-20 Thread Mark H Weaver
Hi Joshua, Joshua Datko writes: > Is it possible to change the default interpreter behavior to display > hex instead of octets for bytevectors and u8-lists? And if so, how to > do so? > > The default, as y'all know is: > > scheme@(guile-user)> #vu8(#x0a #xaa) > $6 = #vu8(10 170) > > But I would

Re: reading from input pipe is slow?

2018-06-22 Thread Mark H Weaver
Hi Thomas, Thomas Danckaert writes: > I've notice that reading a child process' stdout from a port opened > with (open-input-pipe "command") is very slow. In fact, it's faster > to redirect the child process' output to a temporary file, and then > read this temporary file from Guile, than to

Re: Trouble trying to use some modules from the docs (Matt Wette)

2018-06-05 Thread Mark H Weaver
Hi, Zelphir Kaltstahl writes: > Something must be up with either the Guile REPL or the Guile REPL inside > Emacs' M-x shell. I tried to run socket in it and it could not find > that. I also ran other code before that, so maybe the issue was, that > that somehow prevented the REPL from finding

Re: macroexpand-1

2018-06-03 Thread Mark H Weaver
Hi, Catonano writes: > 2018-05-30 3:07 GMT+02:00 Mark H Weaver : > > This is just a toy, and not very useful in practice. > Here's the equivalent formulation for Guile: > >(use-modules (system syntax) > (srfi srfi-11)) > >(define (syntax-

Re: conditional code segments

2018-06-01 Thread Mark H Weaver
Hi Matt, Matt Wette writes: > In C I can use `#ifdef' .. `#endif' to "comment out" code segments. > > In Scheme, one can use `#|' and '|#' which is OK but requires dealing with > both ends of the > segment to switch on / off. And emacs (v 24.5) scheme mode does not always > fontify the

Re: macroexpand-1

2018-05-29 Thread Mark H Weaver
Hi, Catonano writes: > 2018-05-29 17:01 GMT+02:00 Mark H Weaver : > > what's the problem with macroexpand-1 and syntax-case ? > > In Guile 1.x, 'macroexpand-1' performed a single macro expansion step at > the top-level form of an expression, using its old non-hygienic

Re: CPS mystery

2018-05-29 Thread Mark H Weaver
Hi Matt, Matt Wette writes: > I'm trying to generate CPS to feed to the compiler tower. > The following program is supposed to evaluate, expressed in Scheme, `(+ 1 2)'. > That is, essentially, > scheme@(guile-user)> (apply + '(1 2)) > $1 = 3 > I get the error message following. Any clues

Re: German translation of R5RS

2018-05-29 Thread Mark H Weaver
Hi Florian, "pelzflorian (Florian Pelz)" writes: > Please accept my patches adding a German language info file for R5RS > and fixing some small errors in English R5RS. I believe the patches > to be reasonably correct. I very much appreciate this enormous amount of work that you've done! My

Re: macroexpand-1

2018-05-29 Thread Mark H Weaver
Hi, Catonano writes: > in the NEWS file, I read: > > > ... > ** Removed function: `macroexpand-1' > > It is unclear how to implement `macroexpand-1' with syntax-case, though > PLT Scheme does prove that it is possible. > > > what's the problem with macroexpand-1 and syntax-case ? In Guile 1.x,

Re: help : call function with args

2018-04-03 Thread Mark H Weaver
amnesia writes: > To view the message, please use an HTML compatible email viewer. This single line was the only data in your email. There was no HTML MIME part, although even if there was, I would not attempt to read it. I will only read plain text emails on this list.

Re: Building Guile from git sources stuck during make

2018-03-25 Thread Mark H Weaver
Jeremy Korwin-Zmijowski writes: > Oh yeah sorry guys, I let it work during the whole night and it did it ! > I thought it was stuck because from git sources (hours) it took > longer than from tarball sources (minutes, maybe an hour). > > But after a 'sudo make

  1   2   3   4   >