Re: Guile not running properly on GNU/Hurd

2013-02-03 Thread Richard Braun
On Sat, Feb 02, 2013 at 07:51:38PM +0100, Gabriel Schnoering wrote:
> I can't run guile in gdb as there are some error with the garbage
> collector.

These are probably not errors. Many language interpretors rely on
receiving SIGSEGV to implement memory. Use the gdb "handle" command to
make it automatically pass on SIGSEGV signals so that you only catch the
SIGILL you're interested in.

-- 
Richard Braun



automake 1.12

2013-02-03 Thread Andy Wingo
Another public service announcement :)

Automake 1.13 defaults to running tests in parallel.  It saves test
output into files and just reports pass/fail results for the test as a
whole.  This doesn't work so well for Guile, which has its own test
runner.

The way to work around this is to specify "serial-tests" as an automake
option, which is what Guile in git does.  However, this option was only
introduced in Automake 1.12.  So, Guile from git (stable-2.0 and master)
requires Automake 1.12, to work around an incompatibility with 1.13 (!).

However!  Many people use Debian, which only has 1.11.  However 1.12 is
in experimental.  To install automake from experimental, do:

  sudo apt-get install -t experimental automake

It shouldn't bring in any other bleeding-edge deps.

See also
http://lists.gnu.org/archive/html/bug-automake/2013-01/msg00156.html.

Cheers,

Andy
-- 
http://wingolog.org/



syntax-case guards

2013-02-03 Thread Aleix Conchillo Flaqué
Hi,

I'm trying to use a syntax-case guard when the pattern has ellipsis.
So I have something like,

  ((_ (struct (k v) ...))
   (string? (syntax->datum #'k))
   exp)

And I want k to be a string. However, I am getting this error:

missing ellipsis in form (syntax k)

In ice-9/boot-9.scm:
   106:20  0 (# # …)

For patterns without ellipsis it works great.

So, how do I make the guard when I have a pattern with ellipsis?

Thanks in advance,

Aleix



Re: syntax-case guards

2013-02-03 Thread Ian Price
Aleix Conchillo Flaqué  writes:

> Hi,
>
> I'm trying to use a syntax-case guard when the pattern has ellipsis.
> So I have something like,
>
>   ((_ (struct (k v) ...))
>(string? (syntax->datum #'k))
>exp)
You were probably wanting this to apply to each and every k
individually? syntax-case does not work this way. Patterns with ellipsis
are expected to be matched with templates with ellipsis. Sorry.

> So, how do I make the guard when I have a pattern with ellipsis?
using every from (srfi srfi-1) or for-all from (rnrs lists) [same
procedure different name] you get

(every (compose string? syntax->datum) #'(k ...))

As an aside, this won't work in Racket, since they also make lists into
syntax objects, unlike psyntax or the r6rs.

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"



Re: guile-lib 0.2.2 released

2013-02-03 Thread Ian Price
Andy Wingo  writes:

> I am pleased to announce that Guile-Lib 0.2.2 has been released. It
> may be obtained at:
>
>   http://download.savannah.gnu.org/releases/guile-lib/guile-lib-0.2.2.tar.gz

I've updated the version on guildhall accordingly.

'guild update' to fetch the latest available.scm, and
'guild install guile-lib' to install, or
'guild upgrade' to upgrade an existing one

I've attached the pkg-list.scm file I used for it. It's a small
modification of the one I posted previously.

Two notes: This only installs the packages that do not come with Guile
2. After the change to make ... a special marker on the path, this is no
longer necessary, and should probably be changed to simplify the file.

Also, it does not build documentation & install for guile-lib, this will
be one of the things I want to address this year with guildhall, along
with some known interface bugs, the srfi package issues, and support for
C etc. A full post will be made later in the week.(promise :)

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"

;;; pkg-list.scm --- pkg-list.scm for guildhall
;; Copyright (C) 2012,2013 Ian Price 
;; Copyright (C) 2003-2007,2010,2011,2013 Andy Wingo, Richard Todd

;; Permission is granted to copy, distribute and/or modify this
;; document under the terms of the GNU Free Documentation License,
;; Version 1.2 or any later version published by the Free Software
;; Foundation; with no Invariant Sections, no Front-Cover Texts, and
;; no Back-Cover Texts. A copy of the license is included in the
;; section entitled "GNU Free Documentation License".

;;; Commentary:
;;; Guile >= 2 only.
;;; Modules that are in guile 2 already are not included, nor is the
;;; compatibility file.
;;; Contains information from the guile-lib info page

;;; Code:
(package (guile-lib (0 2 2))
  (provides
   apicheck
   config-load
   container-async-queue
   container-delay-tree
   container-nodal-tree
   debugging-assert
   debugging-time
   graph-topological-sort
   htmlprag
   io-string
   logging-logger
   logging-port-log
   logging-rotating-log
   match-bind
   math-minima
   math-primes
   os-process
   scheme-documentation
   scheme-kwargs
   search-basic
   string-completion
   string-soundex
   string-transform
   string-wrap
   term-ansi-color
   unit-test
   md5
   texinfo-nodal-tree
   )
  (synopsis "a down-scaled, limited-scope CPAN for Guile")
  (description
   "- apicheck: Describe and verify library programming interfaces"
   "- config load: Loading configuration files"
   "- container async-queue: A thread-safe message queue"
   "- container nodal-tree: A tree consisting of nodes with attributes"
   "- container delay-tree: A nodal tree with lazily evaluated fields"
   "- debugging assert: Helpful assert macro"
   "- debugging time: A simple macro to time the execution of an expression"
   "- graph topological-sort: Routines to perform topological sorts"
   "- htmlprag: Neil Van Dyke's permissive (\"pragmatic\") HTML parser"
   "- io string: SLIB's IO routines dealing with strings"
   "- logging logger: A flexible logging system"
   "- logging port-log: A logger that outputs to a port"
   "- logging rotating-log: A logger that rotates its output files"
   "- match-bind: Nifty and concise regular expression routines"
   "- math minima: A golden-section minimum finder"
   "- math primes: Functions related to prime numbers and factorization"
   "- os process: Spawning processes and capturing their output"
   "- scheme documentation: Macros to define different kinds of variables with 
documentation"
   "- scheme kwargs: Defining functions with flexible keyword arguments"
   "- search basic: Classic search functions"
   "- string completion: Building blocks for tab completion"
   "- string soundex: The SOUNDEX string categorization algorithm"
   "- string transform: Beyond SRFI-13"
   "- string wrap: A versatile string formatter"
   "- term ansi-color: Generate ANSI color escape sequences"
   "- unit-test: A JUnit-style unit testing framework"
   "- md5: MD5 hashing"
   "- texinfo nodal-tree: A nodal tree for texinfo"
   )
  (homepage "http://www.nongnu.org/guile-lib/";)
  (libraries
   (("src" "config") -> "config")
   (("src" "container") -> "container")
   (("src" "debugging") -> "debugging")
   (("src" "graph") -> "graph")
   (("src" "io") -> "io")
   (("src" "logging") -> "logging")
   (("src" "math") -> "math")
   (("src" "os") -> "os")
   (("src" "scheme") -> "scheme")
   (("src" "search") -> "search")
   (("src" "string") -> "string")
   (("src" "term") -> "term")
   (("src" "apicheck.scm") -> "apicheck.scm")
   (("src" "htmlprag.scm") -> "htmlprag.scm")
   (("src" "match-bind.scm") -> "match-bind.scm")
   (("src" "md5.scm") -> "md5.scm")
   (("src" "unit-test.scm") -> "unit-test.scm")
   (("src" "texinfo" "nodal-tree.scm") -> ("texinfo" "nodal-tree.scm"


Re: syntax-case guards

2013-02-03 Thread Stephen Compall
On Feb 3, 2013 6:56 PM, "Aleix Conchillo Flaqué" 
wrote:
> So I have something like,
>
>   ((_ (struct (k v) ...))
>(string? (syntax->datum #'k))
>exp)
>
> And I want k to be a string. However, I am getting this error:
>
> missing ellipsis in form (syntax k)

The error is correct; k lives in single-ellipsis world.  What should k mean
to syntax->datum?  The first k?  The last k?

Try changing #'k to #'(k ...), and adjusting the guard to deal with list of
k, such as you will get, instead of just k.

--
Stephen Compall
If anyone in the MSA is online, you should watch this flythrough.


Re: syntax-case guards

2013-02-03 Thread Aleix Conchillo Flaqué
On Sun, Feb 3, 2013 at 5:14 PM, Ian Price  wrote:
>
> You were probably wanting this to apply to each and every k
> individually? syntax-case does not work this way. Patterns with ellipsis
> are expected to be matched with templates with ellipsis. Sorry.
>

Yes. I see.

> using every from (srfi srfi-1) or for-all from (rnrs lists) [same
> procedure different name] you get
>
> (every (compose string? syntax->datum) #'(k ...))
>

Great, that did it!.

> As an aside, this won't work in Racket, since they also make lists into
> syntax objects, unlike psyntax or the r6rs.
>

By now, this doesn't worry much, but good to know.

Thank you so much,

Aleix