built-in procedural logical operator

2015-09-01 Thread Alex Vong
Hi everyone, I am learning scheme, please bear with me if I am wrong. I try to define a new function LIST-OF-STRING? (define (list-of-string? lst) (reduce and #f (map string? lst))) and I get the error While compiling expression: ERROR: Syntax error: unknown location: sou

Re: built-in procedural logical operator

2015-09-01 Thread Alex Vong
2015-09-02 0:21 GMT+08:00, David Kastrup : > From (srfi srfi-1): > > (and ...) -> (every identity ... > (or ...) -> (any identity ... > (define (list-of-string? lst) (every string? lst)) > > Of course, this definition returns #t for '() while your definition > returns #f for '(). I'd argue the for

Re: [ANN] Shroud 0.1 released

2015-09-30 Thread Alex Vong
Hi everyone, I am new to encryption programs. The only thing I have done so far is to use GPG to generate myself a key and to sign a tarball. What should I read next to understand the whole concept of encryption and what can I do with it to protect my piracy? Do you recommend people new to encrypt

Re: list of guile related projects

2015-11-25 Thread Alex Vong
It would be great to add `GNU Make` to `guile integration or other combination` as well according to . Cheers, Alex On 24/11/2015, tantalum wrote: > here is a list of projects with code that guile can run and projects tha

Re: --listen option broken on Mac

2015-12-28 Thread Alex Vong
Matthew Keeter writes: > Hi Guile-folks, > > I’m having trouble with the --listen option on Guile 2.0.11, Mac OS 10.9.5. > > I start up one REPL with “guile --listen”, then connect with “nc localhost > 37146” > The netcat window immediately fills with (repeating over and over): > > scheme@(g

Re: Simulating rational number addition/subtraction

2016-02-26 Thread Alex Vong
writes: > On Wed, Feb 24, 2016 at 06:32:12PM -0500, dsm...@roadrunner.com wrote: > > [representing rationals] > >> This https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-14.html >> might be enlightening There are also video lectures recorded in 1986 in addition to the book

Re: some possible bugs and getting procedure on the top of the stack

2016-03-20 Thread Alex Vong
l...@gnu.org (Ludovic Courtès) writes: > Hello! > > Did you mean to email guile-user@gnu.org? > Yes! > Alex Vong skribis: > >> When trying to write some C binding to flex using libguile-2.0, I notice > > FWIW, I’d suggest using something like Danny Dubé’s SILex in

Re: filename(CJK utf8) problem on OSX.

2016-03-27 Thread Alex Vong
Park SungMin writes: > follow code….. I just test openfile(CJK filename). > "open-file" and "call-with-input-file" are raise error. so I test use low > C(Posix) API, then run ok! > I don’t know is it bug? or option problem? > > > (use-modules (rnrs io ports) > (rnrs byt

Re: How to get the preferred environment variable path separator?

2016-03-28 Thread Alex Vong
Hi, Chris Marusich writes: > Hi, > > Info node "(guile) File System" describes a procedure for getting the > preferred file name separator of the operating system: > > -- Scheme Variable: file-name-separator-string > The preferred file name separator. > > Note that on MinGW builds for

Re: How to get the preferred environment variable path separator?

2016-03-28 Thread Alex Vong
"Thompson, David" writes: > On Mon, Mar 28, 2016 at 6:00 AM, Alex Vong wrote: >> Hi, >> >> Chris Marusich writes: >> >>> Hi, >>> >>> Info node "(guile) File System" describes a procedure for getting the >>>

C-c in guile

2017-01-21 Thread Alex Vong
Hello, When running the external program "yes" in shell, $ yes We can terminate the process by pressing C-c. However, when running the external program "yes" in guile, $ guile -c '(system* "yes")' We cannot terminate the process by pressing C-c, but we can suspend it by pressing C-z. Why

Re: C-c in guile

2017-01-21 Thread Alex Vong
Matt Wette writes: >> On Jan 21, 2017, at 3:55 AM, Alex Vong wrote: >> >> Hello, >> >> When running the external program "yes" in shell, >> >> $ yes >> >> We can terminate the process by pressing C-c. >> >> H

Re: Playing with guile (vs python). Generate file for GDP suitable for gnuplot.

2017-01-30 Thread Alex Vong
Hello, Germán Diago writes: > Hello everyone, > > I did a script that parses some file with the GDP since 1970 for many > countries. I filter the file and discard uninteresting fields, later I > write in a format suitable for gnuplot. > Wow, you started programming before I was born! > I did t

Re: C-c in guile

2017-03-01 Thread Alex Vong
Andy Wingo writes: > On Sat 21 Jan 2017 12:55, Alex Vong writes: > >> However, when running the external program "yes" in guile, >> >> $ guile -c '(system* "yes")' >> >> We cannot terminate the process by pressing C-c, > &g

Re: ?-suffix for booleans... good-idea? or bad-idea?

2017-04-24 Thread Alex Vong
Good question! I can't decide as well. I want to know how people think about it. In a lazy language, a variable is a 0-ary thunk, while a predicate is a 1-ary thunk. Since they are really just special case of a general thing, it make sense to use foo? for both cases. But we all know guile is not l

Re: C-c in guile

2017-05-15 Thread Alex Vong
sync-safe functions. So I re-implement the whole thing in C and exec right after forking. This is how I come up with the current solution. /* Copyright (C) 2017 Alex Vong * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Pub

Re: Request for assistance: (assertion-violation) unbound variable

2017-06-10 Thread Alex Vong
Peter Silcock writes: > As a newcomer to Guile/Scheme, I am working my way through some > exercises which require the use of an (assertion-violation) procedure > to trap an error condition, specifically: > > (if (empty? queue) > (assertion-violation 'getq "Queue is empty"))) > > When I run th

Re: Guile 2.2 Debian packages

2017-06-12 Thread Alex Vong
Hi Tommi, Tommi Höynälänmaa writes: > Hello > > Where can I find Guile 2.2 Debian packages for the amd64 architecture > (Intel)? > > Where can I find the Debian files (subdirectory debian) for the Guile > 2.2 source package? > > - Tommi Höynälänmaa A Debian package search[0] suggests Guile

Re: Q about interrupt and catch

2017-06-12 Thread Alex Vong
"Mike Gran" writes: > Hi all, > > This is probably a simple question, but, I can't figure it out. > > I have a program with a big main loop like this > > (while #t > (let ((c (read-char port))) >(cond > ... many different possible operations, depending on c > ))) > > I want to make i

Re: Multiple values passed as single argument to procedure

2017-06-26 Thread Alex Vong
Here is an explanation of multiple values by Oleg[0] and an implementation from the Scheme book[1]. These are more advanced stuff. Honestly, I usually don't understand what Oleg said. But it is good to know these references. It is like math, one day when you have enough background and the right per

Can Guile be bootstrapped from source without psyntax-pp.scm?

2017-07-06 Thread Alex Vong
Hello, Recently, I've read the chapter on Macros in Guile's manual. The manual says that Guile's expander originated from that of Chez Scheme's and that version was portable to other schemes as well. So I search the Internet and find it[0]. The website states that the expander needs an expanded v

Re: Can Guile be bootstrapped from source without psyntax-pp.scm?

2017-07-07 Thread Alex Vong
Hi Mark, Mark H Weaver writes: > Hi Alex, > > Alex Vong writes: > >> Recently, I've read the chapter on Macros in Guile's manual. The manual >> says that Guile's expander originated from that of Chez Scheme's and >> that version was

Re: string-unfold demo

2017-08-28 Thread Alex Vong
Hello Guilers, Since I find this exercise interesting, I come up with another demo. The trick is to think of string as a list of characters (like in Haskell) and to use the fact that append can be written as an unfold. Let's begin: 1. Use SRFI-1 and SRFI-26 (use-modules (srfi srfi-1)

Re: underscores in debug output?

2017-08-30 Thread Alex Vong
Christopher Howard writes: > Hi, what does the underscore character mean in this debug output? > >    159:37  5 (delete ((3 . "c") (((2 . "b") (()) 1) (5 . "e") (()) 1) > 2) 2) >    163:49  4 (delete ((2 . "b") (()) 1) _) > 152:9  3 (delete _ _) > 86:11  2 (skew _) >  64:6  1 (horizon

Re: Guile Release Signing Key? (Laptop stolen 7 August 2017 ???)

2017-09-16 Thread Alex Vong
Christopher Howard writes: > Hi, I'm in the habit of checking release signatures before I install > from source. I see in the Download area there are signatures for each > of the Guile releases, but I can't seem to find the right public key. I > imported the project key chain and then (re?)import

[PATCH] Bump version to 2.2.2. (was: The website's 2.x series release information is out of date)

2017-11-08 Thread Alex Vong
.2.x series is 2.2.0", and links to the 2.2.0 > release. But the latest release on the ftp site is 2.2.2. Indeed, the website seems to be out of sync. The following patch bumps the latest-guile-version to 2.2.2: From cd1e592eacb8e24981664f822fab106036b7acc0 Mon Sep 17 00:00:00 2001 From: A

Re: [PATCH] Bump version to 2.2.2.

2017-11-13 Thread Alex Vong
l...@gnu.org (Ludovic Courtès) writes: > Hello! > > Alex Vong skribis: > >> Tom Jakubowski writes: >> >>> Unsure if this is the right list; if it's the wrong one, then I'm sorry! >>> >> Thanks for your report, I think you are on the

Re: Repeat syntax

2017-11-25 Thread Alex Vong
Christopher Howard writes: > Hi list, I want to have a function > > (repeat n exp exp* ...) > > That calls the expressions n times for side effect, like for-each, but > without the bother of dealing with a list. It seems like somebody else > must have thought of this before, but I couldn't find

Re: function registered with scm_c_define_gsubr: how can i handle an optional parameter?

2017-12-14 Thread Alex Vong
Hello, From the Guile manual ``6.1 Overview of the Guile API'', >For some Scheme functions, some last arguments are optional; the > corresponding C function must always be invoked with all optional > arguments specified. To get the effect as if an argument has not been > specified, pass ‘SCM

Re: function registered with scm_c_define_gsubr: how can i handle an optional parameter?

2017-12-14 Thread Alex Vong
Hello Mark, Oh, I didn't really think too much about this. I always thought immediate objects like SCM_EOL, SCM_BOOL_T, ..., SCM_UNDEFINED can be compared using '=='. Is this an implementation detail that I should not depend on? Mark H Weaver writes: > Hi Alex, > > Alex

Re: function registered with scm_c_define_gsubr: how can i handle an optional parameter?

2017-12-15 Thread Alex Vong
Mark H Weaver writes: > Hi Alex, > > Alex Vong writes: > >> Oh, I didn't really think too much about this. I always thought immediate >> objects like SCM_EOL, SCM_BOOL_T, ..., SCM_UNDEFINED can be compared >> using '=='. Is this an impleme

Re: Bytestructures 1.0.1

2018-01-07 Thread Alex Vong
taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes: > Amazingly, a bug that existed for months has been coincidentally > discovered hours after I made the release. :-)) > > The alignment of vectors and unions within structs was not being > calculated correctly. Fortunately, it was a

Re: conditional code segments

2018-06-01 Thread Alex Vong
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 buffer > correct

Re: Problem when compile guile-2.2.4 on CentOS 6.10/6.8

2018-09-04 Thread Alex Vong
Hello An, Can you also upload the 'config.log' file? As it may contain some hints on why it is failing. Cheers, Alex An Liu writes: > Hi, List > > I'm trying to compile guile-2.2.4 on CentOS 6.10, but failed > > - why guile-2.2.4? > I want to try artanis which requires guile-2.2+, and yum repo

Re: Problem when compile guile-2.2.4 on CentOS 6.10/6.8

2018-09-05 Thread Alex Vong
> --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic > > --with-arch_32=i686 --build=x86_64-redhat-linux > > Thread model: posix > > gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) > > > > > > > > > > i would like to

Re: Beginner questions

2018-10-30 Thread Alex Vong
swedebugia writes: > Hi > Hello, > I would like to learn more scheme and I would like to make a small CLI If you have time, I suggest you to watch the Structure and Interpretation of Computer Programs (SICP) lecture series[0][1]. It is a classic. The videos were recorded in 1986. However, the t

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

2018-11-04 Thread Alex Vong
Hello, Thomas Morley writes: > Hi, > > 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 vari

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

2018-11-06 Thread Alex Vong
Thomas Morley writes: [...] > > Hi Alex, > > thanks for the hint. > Would a patch like attached be sufficient? > I am not sure. Looking into the source, in the "Current ports as parameters" section, you can see that 'current-*-port' are being defined. They feel like some kind of wrappers around t

Re: Cryptic error messages: Bug in guile?

2018-11-12 Thread Alex Vong
Hello, swedebugia writes: > Hi > > I try to package for guix. > Sometimes I forget a parens somewhere. > > When I invoke make in the guix source tree the parens error will be > reported as any other kind of error. (unbound variable, package not > found, etc) > > I would like to know if there is

Re: How to build GNUTLS Guile bindings on Xubuntu

2018-11-16 Thread Alex Vong
Hi Zelphir, Zelphir Kaltstahl writes: > Hi Mark, > > 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: > https://www.gnu.org/sof

Re: How to build GNUTLS Guile bindings on Xubuntu

2018-11-16 Thread Alex Vong
Hello Mark, Mark H Weaver writes: > 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 >>

Re: How to build GNUTLS Guile bindings on Xubuntu

2018-11-17 Thread Alex Vong
Mark H Weaver writes: > 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. >> >>

Re: Guile 2.2.4 warnings

2018-12-02 Thread Alex Vong
Hello Tommi, Tommi Höynälänmaa writes: > Hello > > 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

Re: help with guile-json inconsistencies

2018-12-10 Thread Alex Vong
Hello Aleix, Aleix Conchillo Flaqué writes: > On Sun, Dec 9, 2018 at 10:33 PM Aleix Conchillo Flaqué > wrote: >> >> On Sun, Dec 9, 2018 at 2:56 AM Aleix Conchillo Flaqué >> wrote: >> > >> > Hi guilers, >> > >> > a new guile-json issue came to me recently: >> > >> > https://github.com/aconchill

Re: Need help with macro

2018-12-12 Thread Alex Vong
Hello 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: socketpairs

2019-02-08 Thread Alex Vong
Hello, Catonano writes: > I don't understand what socketpairs are for > > The manual states: > > -- Scheme Procedure: socketpair family style proto > -- C Function: scm_socketpair (family, style, proto) > Return a pair, the ‘car’ and ‘cdr’ of which are two unnamed socket > ports conn

Re: Which package is your goto package for pretty-printing javascript?

2019-02-26 Thread Alex Vong
[I'm CC'ing guile-user because what I'm about to say might be more relevant there...] Vladimir Sedach writes: > I use json-reformat.el in Emacs, and the jq program (which does > pretty-printing, among many other things) when I have to shell > script. > Isn't both programs work with json instead

Re: Some reader syntax for data structures

2019-03-30 Thread Alex Vong
Thanks for creating this! I enjoy the clojure hash-map syntax and I think guile vhash can sort of fit this place with a good reader syntax. Ivan Kupalov writes: > Hello everyone! > > I wanted to learn some Scheme before starting one project and it > seemed to me that it might be a nice exercise