Fixing `flush-output-port` for R6RS transcoded ports

2020-02-16 Thread Andreas Rottmann
Hi! As I reported in #39610 [0], `flush-output-port`, aka `force-output` is no longer working for R6RS transcoded ports. It was still working in Guile 2.0; the regression was introduced in Guile 2.2, via commit "8399e7af5 ("Generic port facility provides buffering uniformly"). I'd be interested i

Re: Psyntax security hole prevents secure sandboxing in Guile

2012-05-07 Thread Andreas Rottmann
though > that would make communication harder. > Racket has a facility that achieves sandboxing (with the above property of CPU and RAM usage bounds), i believe: http://docs.racket-lang.org/reference/Sandboxed_Evaluation.html Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: Our temporary guildhall package repository down?

2012-05-27 Thread Andreas Rottmann
he documentation, and make an initial release. However, my hacking time ATM is quite limited, so I cannot give any date of when this will eventually happen. Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: [PATCH] Add ".guile.sls" and ".sls" to the default %load-extensions

2012-11-04 Thread Andreas Rottmann
havior by default, but provide a command-line switch; however, enabling this behavior is *already* possible using command-line switches ("-x .guile.sls -x .sls"), so I don't know... Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

[PATCH] Make `get-datum' conform more closely to R6RS semantics

2012-11-04 Thread Andreas Rottmann
* module/rnrs/io/ports.scm (get-datum): Set reader options to be more compatible with R6RS syntax. With Guile's default reader options, R6RS hex escape and EOL escape behavior is missing. This change enables the former via the `r6rs-hex-escapes' option, and gets us closer to the latter by

Re: [PATCH] Add ".guile.sls" and ".sls" to the default %load-extensions

2012-11-04 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Hi! > > Andreas Rottmann skribis: > >> For performance reasons, it *might* make sense to not enable this >> behavior by default, but provide a command-line switch; however, >> enabling this behavior is *already* possib

Re: [PATCH] Make `get-datum' conform more closely to R6RS semantics

2012-11-06 Thread Andreas Rottmann
Mark H Weaver writes: > Hi Andreas, > > Andreas Rottmann writes: >> * module/rnrs/io/ports.scm (get-datum): Set reader options to be more >> compatible with R6RS syntax. >> >> With Guile's default reader options, R6RS hex escape and EOL escape >>

Re: Release time!

2012-11-06 Thread Andreas Rottmann
ot as tedious as it might sound: the pkg-list.scm file would have to list each SRFI, but the collection of portable SRFIs can still be maintained in a single source repository and dorodango bundle (i.e. unit of distribution). Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

[PATCH] Fix `get-string-n!' &i/o-decoding exception behavior

2012-11-07 Thread Andreas Rottmann
Previously, `get-string-n!' from `(rnrs io ports)' would not throw the exception required by R6RS, and could not easily do so due to being implemented entirely in C. This change fixes this by introducing a corresponding internal C function reporting errors by return value and reimplementing the `g

Re: Adding to the end of the load path

2012-11-07 Thread Andreas Rottmann
n over a guildhall provided one, when this exists. Right > now, for the srfi[0] and guile-lib, I have handled this by not adding > files to the package where they have been adopted by guile (e.g. statprof). > > Andreas Rottmann suggested something similar in February[1]. > I'

Re: [PATCH] Add ".guile.sls" and ".sls" to the default %load-extensions

2012-11-08 Thread Andreas Rottmann
elatedly) *indeed* lacking is a way to make native libraries take precedence to the third-party libraries installed by dorodango. This would be addressed by making the $GUILE_LOAD_PATH (and $GUILE_LOAD_COMPILED_PATH) mechanism to not only prepend, but also append to the compiled-in load path, as implemented by the patch I posted [0]. [0] http://lists.gnu.org/archive/html/guile-devel/2012-11/msg00056.html -- Andreas Rottmann -- <http://rotty.xx.vu/>

Re: [PATCH] Fix `get-string-n!' &i/o-decoding exception behavior

2012-11-11 Thread Andreas Rottmann
Mark H Weaver writes: > Hi Andreas, > > Thanks for the patch. See below for my comments. > > Andreas Rottmann writes: > >> diff --git a/libguile/ports.c b/libguile/ports.c >> index 55808e2..b653af4 100644 >> --- a/libguile/ports.c >> +++

Re: Adding to the end of the load path

2012-11-11 Thread Andreas Rottmann
Mark H Weaver writes: > Hi Andreas, > > Andreas Rottmann writes: > >> Ian Price writes: >> >> From 1f72ddd3971a796a6f83a68ebedde7d7324c50b5 Mon Sep 17 00:00:00 2001 >> From: Andreas Rottmann >> Date: Thu, 8 Nov 2012 01:59:56 +0100 >> Sub

Re: [PATCH] Fix `get-string-n!' &i/o-decoding exception behavior

2012-11-12 Thread Andreas Rottmann
Mark H Weaver writes: > Andreas Rottmann writes: > >> Mark H Weaver writes: >> >>> Why not leave the API as-is, and in the event of an error, just raise >>> the proper R6RS exception from within 'scm_get_string_n_x'? >>> >> The prob

[PATCH] Add missing R6RS `open-file-input/output-port' procedure

2012-11-12 Thread Andreas Rottmann
* module/rnrs/io/port.scm (r6rs-open): New internal helper procedure for opening files. (open-file-input-port, open-file-output-port): Make use of `r6rs-open'. (open-file-input/output-port): Implement in terms of `r6rs-open', add to exported identifiers list. * module/rnrs.scm (open-file

Re: [PATCH] Add missing R6RS `open-file-input/output-port' procedure

2012-11-13 Thread Andreas Rottmann
Mark H Weaver writes: > Hi Andreas, > > This patch looks good to me! > Thanks for the quick review, also for the other patches! I've pushed this one now. Cheers, Rotty -- Andreas Rottmann -- <http://rotty.xx.vu/>

Re: Adding to the end of the load path

2012-11-15 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Hi! > > Sorry for the delay. > > Andreas Rottmann skribis: > >> Ian Price writes: > > [...] > >>> Andreas Rottmann suggested something similar in February[1]. >>> >> I've attached a pat

Re: thoughts on native code

2012-11-15 Thread Andreas Rottmann
r.sls;hb=HEAD [1] http://rotty.xx.vu/gitweb/?p=scheme/avrth.git;a=summary [2] http://amforth.svn.sourceforge.net/viewvc/amforth/trunk/lib/assembler.frt?revision=1301&view=markup [3] http://amforth.sourceforge.net/ Regards, Rotty -- Andreas Rottmann -- <http://rotty.xx.vu/>

Fix reader options for R6RS `get-datum'

2012-12-09 Thread Andreas Rottmann
This patch series addresses the problem that `get-datum' is using the global reader options, even for those options that have to have fixed values to make the reader behave in an R6RS-compatible way. * [PATCH 1/3] Split r6rs-ports.c according to module boundaries Needed by the last patch, since

[PATCH 2/3] Add internal API to specify reader options at reader invocation

2012-12-09 Thread Andreas Rottmann
* libguile/private-options.h: Introduce a new enum indexing the read options, and use its values as indices for scm_read_opts. * libguile/read.c: Get rid of the bit field offsets #define-s, and instead use the enum values to caculate them. * libguile/read.c (enum t_keyword_style, scm_t_read_op

[PATCH 3/3] Make `get-datum' conform more closely to R6RS semantics

2012-12-09 Thread Andreas Rottmann
With Guile's default reader options, R6RS hex escape and EOL escape behavior is missing. This change enables the former via the `r6rs-hex-escapes' option, and gets us closer to the latter by setting `hungry-eol-escapes'. * libguile/r6rs-ports.c (R6RS_READ_OPTION_MASK): New macro, defines which

Re: Fix reader options for R6RS `get-datum'

2012-12-12 Thread Andreas Rottmann
Mark H Weaver writes: > Hi Andreas, > > Andreas Rottmann writes: >> This patch series addresses the problem that `get-datum' is using the >> global reader options, even for those options that have to have fixed >> values to make the reader behave in an R6RS-compa

Re: Fix reader options for R6RS `get-datum'

2012-12-13 Thread Andreas Rottmann
Mark H Weaver writes: > Hi Andreas, > > Andreas Rottmann writes: >> Mark H Weaver writes: >>> Andreas Rottmann writes: >>>> This patch series addresses the problem that `get-datum' is using the >>>> global reader options, even for those op

Re: Fix reader options for R6RS `get-datum'

2012-12-17 Thread Andreas Rottmann
Mark H Weaver writes: > Andreas Rottmann writes: > >> Mark H Weaver writes: >> >>> Section 8.3 defines 'read' as follows: >>> >>> Reads an external representation from textual-input-port and returns >>> the datum it represents

Re: Build failure (stable-2.0, "make distcheck")

2013-01-02 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Hi Andreas, > > Andreas Rottmann skribis: > >> mkdir: cannot create directory '.am27744': Permission denied >> ../../../doc/ref/guile.texi: No such file or directory >> make[5]: *** [../../../doc/ref/guile.info] Er

Re: Build failure (stable-2.0, "make distcheck")

2013-01-07 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Andreas Rottmann skribis: > >> It is the case; guile.info is present, but it seems that it's not newer >> that one of the sources it's built from: >> >> % tar --utc -tvf _build/guile-2.0.7.13-b5d83.tar.gz | grep -

Re: [PATCH] Split r6rs-ports.c according to module boundaries

2013-11-30 Thread Andreas Rottmann
API, i.e. place the implementation of all these identifiers in (ice-9 binary-ports): eol-style native-eol-style error-handling-mode make-transcoder transcoder-codec transcoder-eol-style transcoder-error-handling-mode native-transcoder latin-1-codec utf-8-codec utf-16-codec Thoughts? -- Andreas Rottmann -- <http://rotty.xx.vu/>

Re: [PATCH 2/3] Add C++ extern "C" guards to internal headers.

2015-07-14 Thread Andreas Rottmann
lines, e.g.: + SCM_BEGIN_DECLS ... + SCM_END_DECLS This is done in GLib, for example, and cuts down the noise a bit. Regards, Rotty -- Andreas Rottmann -- <http://rotty.xx.vu/>

Re: [PATCH 2/3] Add C++ extern "C" guards to internal headers.

2015-07-16 Thread Andreas Rottmann
Taahir Ahmed writes: > On Tuesday 14 July 2015 21:36:31 Andreas Rottmann wrote: >> Just a minor nitpick: it might make sense to add a pair of macros to >> libguile/__scm.h for the '#ifdef __cplusplus' dance, so these >> boilerplate additions become just two line

[PATCH] Add SRFI-25 implementation

2015-07-27 Thread Andreas Rottmann
Adds an implementation of SRFI 25 on top of Guile's native arrays. The implementation does not introduce a disjoint type; Guile arrays and SRFI-25 arrays can be used interchangably, though with different, partly conflicting APIs. * NEWS: Add preliminary, incomplete section on 2.0.12, noting the

[PATCH] Heed the reader settings implied by #!r6rs

2015-07-28 Thread Andreas Rottmann
When encountering the #!r6rs directive, apply the appropriate reader settings to the port. * libguile/read.scm (read-string-as-list): New helper procedure. (scm_read_shebang): Set reader options implied by the R6RS syntax upon encountering the #!r6rs directive. * test-suite/tests/reader.test (

Re: [PATCH] Heed the reader settings implied by #!r6rs

2015-07-28 Thread Andreas Rottmann
Mark H Weaver writes: > Andreas Rottmann writes: > >> When encountering the #!r6rs directive, apply the appropriate reader >> settings to the port. >> >> * libguile/read.scm (read-string-as-list): New helper procedure. >> (scm_read_shebang): Set reade

Re: Reading data from a file descriptor

2015-11-07 Thread Andreas Rottmann
lay (get-bytevector-n port 100)) (display "\n"))) (process-fd (acquire-valid-fd)) You could now just implement `acquire-valid-fd' in C and expose it to Scheme, if that is even necessary. If you have the FD available via e.g. an environment variable, `acquire-valid-fd' can be implemented in Scheme as well. Regards, Rotty -- Andreas Rottmann -- <http://rotty.xx.vu/>

Re: [PATCH] Add SRFI-25 implementation

2015-11-14 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Mark H Weaver skribis: > >> l...@gnu.org (Ludovic Courtès) writes: >> >>> l...@gnu.org (Ludovic Courtès) skribis: >>> >>>> Andreas Rottmann skribis: >>>> >>>>> Adds an implemen

Re: Reading data from a file descriptor

2015-11-23 Thread Andreas Rottmann
writes: > On Fri, Nov 13, 2015 at 10:51:58AM -0500, Mark H Weaver wrote: >> Jan Synáček writes: >> >> > On Sun, Nov 8, 2015 at 12:49 AM, Andreas Rottmann >> > wrote: >> > >> > Also note that if there's no requirement to actually impl

Re: ongoing NEWS

2009-06-18 Thread Andreas Rottmann
Andy Wingo writes: > Autocompiled files will be stored in the user's ~/.guile-ccache > directory, which will be created if needed. This is analogous to > ccache's behavior for C files. > As long as nothing is set in stone, perhaps you want to consider following the XDG basedir spec[0], which woul

Quasisyntax broken?

2009-07-02 Thread Andreas Rottmann
Hi! Playing around with Guile's now-in-core syntax-case support (using Git HEAD as of today), I found that quasisyntax seems quite broken: (define-syntax test (lambda (stx) (syntax-case stx () ((_ id body ...) #`(let ((id #,(symbol->string (syntax->datum #

Re: %nil once again

2009-07-17 Thread Andreas Rottmann
mean why '(1 2 3 . %nil) does yield (1 2 3 . %nil) while `(1 2 3 > . ,%nil) gives the expected (1 2 3). But that does not matter much > besides astonishing me, as this is only something related to the > Scheme implementation of %nil, I guess. > The *symbol* '%nil has absolutely no special status in Scheme. It just happens that Guile provides (in the default environment) a value bound as %nil that has special properties. Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: Quasisyntax broken?

2009-07-23 Thread Andreas Rottmann
Andy Wingo writes: > On Fri 03 Jul 2009 02:04, Andreas Rottmann writes: > >> Playing around with Guile's now-in-core syntax-case support (using Git >> HEAD as of today), I found that quasisyntax seems quite broken: > > We've spoken over IRC since then, but for

Re: Quasisyntax broken?

2009-07-25 Thread Andreas Rottmann
Andy Wingo writes: > Hi, > > On Fri 24 Jul 2009 00:35, Andreas Rottmann writes: > >> Andy Wingo writes: >> >>> On Fri 03 Jul 2009 02:04, Andreas Rottmann writes: >>> >>>> Playing around with Guile's now-in-core syntax-case support

[PATCH] R6RS-style block comments

2009-07-25 Thread Andreas Rottmann
Attached is a patch that extends the read syntax to allow for #| ... |# block comments. From: Andreas Rottmann Subject: [PATCH] Add support for #| ... |# comments This syntax has been added by R6RS. --- NEWS|5 + libguile/read.c | 35

Re: BDW-GC branch updated

2009-08-18 Thread Andreas Rottmann
for switching to a precise GC listed in there will also apply to Guile. Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: BDW-GC branch updated

2009-09-04 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Andreas Rottmann writes: > >> Will going from a precise GC to BDW-GC not have drawbacks? IIRC, the PLT >> people went in the opposite direction. A quick google turned up this: >> >> http://www.cs.brown.edu/pipermail/pl

Re: BDW-GC branch updated

2009-09-15 Thread Andreas Rottmann
ty to do so: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546833 Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: [PATCH] R6RS-style block comments

2009-10-05 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Hi, > > Andreas Rottmann writes: > >> Attached is a patch that extends the read syntax to allow for #| ... |# >> block comments. > > Are there objections to this patch? If no, I’ll apply it. > > Note that it makes

[PATCH] Quasisyntax support

2009-10-05 Thread Andreas Rottmann
Hi! As suggested by Ludovic, I've prepared a new version of the quasisyntax patch with Andre van Tonders MIT-Licensed code in its own file, including the complete license text. From: Andreas Rottmann Subject: [PATCH] Add support for `quasisyntax' --- module/ice-9/boot-9.scm

Feature request: psyntax tail patterns

2009-10-05 Thread Andreas Rottmann
//www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_sec_11.19 [1] http://ikarus-scheme.org/r6rs-libraries/ Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: [PATCH] R6RS-style block comments

2009-10-05 Thread Andreas Rottmann
Andreas Rottmann writes: > l...@gnu.org (Ludovic Courtès) writes: > >> Hi, >> >> Andreas Rottmann writes: >> >>> Attached is a patch that extends the read syntax to allow for #| ... |# >>> block comments. >> >> Are there objections to

Re: [PATCH] R6RS-style block comments

2009-10-14 Thread Andreas Rottmann
e with R6RS, but SRFI-35 is not; I'm not sure wether they are fundamentally incompatible (i.e. neither is implementable on top of the other). Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

G-Wrap 1.9.13 released

2009-10-28 Thread Andreas Rottmann
27;ve migrated the G-Wrap bzr repository to git, see http://www.nongnu.org/g-wrap/development.html Enjoy! Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: G-Wrap 1.9.13 released

2009-10-28 Thread Andreas Rottmann
ls/foreign.sls [1] http://github.com/marcomaggi/nausicaa/blob/master/scheme/src/libraries/foreign/ffi.sls [2] http://common-lisp.net/project/cffi/spec/cffi-sys-spec.html Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

[PATCH] Quasisyntax support, update #2

2009-10-29 Thread Andreas Rottmann
Hi! Here is another update for the quasisyntax patch. It adds two small testcases, and fixes the SRFI-10 test to revert its changes to the global reader table. From: Andreas Rottmann Subject: [PATCH] Add support for `quasisyntax' --- module/ice-9/boot-9.scm |2 + module/

[PATCH] psyntax tail patterns

2009-10-29 Thread Andreas Rottmann
like the above. Alas! [ As a side remark, I don't really understand why one has to implement a macro expander in a way that requires bootstrapping ] From: Andreas Rottmann Subject: [PATCH] Add support for tail patterns to syntax-case and syntax-rules -

Re: Guile 1.8.7 - Licenses

2009-11-13 Thread Andreas Rottmann
reports? I’d be > interested in it, and perhaps it’d be a useful addition to Gnulib. > There is a "licensecheck" Perl script in the Debian package "devscripts", which attempts to do this. I've used it when packaging libunistring for Debian -- it got many files right, but you still need to manually verify and extend the results. Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: r6rs libraries, round three

2009-11-17 Thread Andreas Rottmann
and NEWS entries, and update the documentation (anything else?). [0] http://article.gmane.org/gmane.lisp.guile.devel/9605/match=tail+pattern Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: r6rs libraries, round three

2009-11-17 Thread Andreas Rottmann
se library names | consist of the same sequence of identifiers but whose versions do not | match to co-exist in the same program. ` This makes me wonder if versions can be used (or rather be relied on) sensibly in portable libraries at all... Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

[PATCH] `import' should accept multiple clauses

2010-06-06 Thread Andreas Rottmann
(eval load compile expand) + (let ((iface (resolve-r6rs-interface 'library-reference))) + (call-with-deferred-observers + (lambda () + (module-use-interfaces! (current-module) (list iface) + ... (if #f #f)))

[PATCH] add rnrs unicode to the compound rnrs module

2010-06-19 Thread Andreas Rottmann
The compound module (rnrs) was missing (rnrs unicode). From: Andreas Rottmann Subject: add rnrs unicode to the compound rnrs module * module/rnrs.scm: import rnrs unicode and export all of its procedures. --- module/rnrs.scm | 16 ++-- 1 files changed, 14 insertions(+), 2

[PATCH] ice-9 receive without defmacro

2010-06-19 Thread Andreas Rottmann
From: Andreas Rottmann Subject: ice-9 receive without define-macro * module/ice-9/receive.scm: Replace define-macro usage with syntax-rules. --- module/ice-9/receive.scm | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/ice-9/receive.scm b/module/ice-9

[PATCH] Ignore the SRFI name component(s) in R6RS imports

2010-06-19 Thread Andreas Rottmann
From: Andreas Rottmann Subject: Ignore the SRFI name component(s) in R6RS imports * module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface): To avoid having to create alias libraries for all the SRFIs, we simply ignore the name components, so (srfi :n foo bar) will resolve to (srfi :n

[PATCH] Fix SRFI-9 for records without fields

2010-06-19 Thread Andreas Rottmann
From: Andreas Rottmann Subject: Fix SRFI-9 for records without fields * module/srfi/srfi-9.scm (define-record-type): Deal with fieldless records. * test-suite/tests/srfi-9.test: Add a fieldless record definition. --- module/srfi/srfi-9.scm |4 test-suite/tests/srfi-9.test |2

Re: Why Ice-9?

2010-07-09 Thread Andreas Rottmann
2.0 or for 2.2 > we could provide (ice-9 popen) as an alias to (guile popen), and > eventually for 2.4 deprecate both ice-9 and system. Just a thought, > though... > +1 for that idea from me. Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Random numbers broken on 64-bit platforms

2010-07-16 Thread Andreas Rottmann
ously distorted in their distribution, since scm_c_random() only returns 32 random bits, and that function is used by scm_c_random_bignum(), which expects it to return a `unsigned long' worth of random bits, AFAICT. I believe the attached patch fixes this issue. From: Andreas Rottmann Su

Re: Random numbers broken on 64-bit platforms

2010-07-17 Thread Andreas Rottmann
Andreas Rottmann writes: > Hi! > > While implementing SRFI-27, I noticed that Guile's RNG is quite broken > on 64-bit platforms (where unsigned long is 64 bit). This has two > consequences: > > - Crashes for some numbers between 2^32 and 2^63; for example try this

[PATCH] Allow exposing of random number generator state

2010-07-18 Thread Andreas Rottmann
- suggestions highly appreciated! From: Andreas Rottmann Subject: Allow exposing of random number generator state Now the random number generator state can be obtained in external (i.e. `read'/`write'-able) form via the new procedure `random-state->external'. An externalized

Re: [PATCH] Allow exposing of random number generator state

2010-07-23 Thread Andreas Rottmann
Andy Wingo writes: > On Sun 18 Jul 2010 18:01, Andreas Rottmann writes: > >> Here is a first version of the patch to add an external representation >> for the RNG state (needed for implementing SRFI 27 "Sources of random >> bits" in terms of Guile's RNG).

Implementing R6RS `transcoded-port'

2010-07-25 Thread Andreas Rottmann
scm_i_remove_port (port); SCM_CLR_PORT_OPEN_FLAG (port); SCM_SET_CELL_TYPE (result, (type & 0x) | scm_i_mode_bits (modes)); scm_i_pthread_mutex_unlock (&scm_i_port_table_mutex); scm_set_port_encoding_x (result, codec); return result; } } #undef FUNC_NAME Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Random numbers (again) broken on 64-bit platforms

2010-07-26 Thread Andreas Rottmann
a, which doesn't take into account (in scm_random) that an INUM may well exceed 32 bits on 64-bit platforms. I'll try to come up with a patch for that, unless someone beats me to it. Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: Implementing R6RS `transcoded-port'

2010-07-31 Thread Andreas Rottmann
Thien-Thi Nguyen writes: > () Andreas Rottmann > () Sun, 25 Jul 2010 21:12:22 +0200 > >result_pt->file_name = pt->file_name; >result_pt->line_number = pt->line_number; >result_pt->column_number = pt->column_number; > >

Re: Random numbers (again) broken on 64-bit platforms

2010-08-01 Thread Andreas Rottmann
Andy Wingo writes: > Heya, > > On Mon 26 Jul 2010 23:01, Andreas Rottmann writes: > >> scheme@(guile-user)> (random (ash 1 32)) >> ERROR: In procedure random: >> ERROR: Argument 1 out of range: 4294967296 > > Well, it's not a segfault at least :)

[PATCH] Fix test-srfi-1 linkage

2010-08-13 Thread Andreas Rottmann
From: Andreas Rottmann Subject: Link test-srfi-1 to libguile as well With an installed copy of libguile in place, test-srfi-1 would be run using that instead of the in-tree libguile. * test-suite/standalone/Makefile.am (test_srfi_1_LDADD): Add libguile. --- test-suite/standalone/Makefile.am

[PATCH] Support for SRFI 27

2010-08-14 Thread Andreas Rottmann
Hi! Attached is my take on adding SRFI 27 "Sources of Random Bits". From: Andreas Rottmann Subject: Add implementation of SRFI 27 * module/srfi/srfi-27.scm: New file; implementation of SRFI 27 in terms of the existing random number generator. * module/Makefile.am (SRFI_SOURCES)

[PATCH] Some R6RS fixes

2010-08-14 Thread Andreas Rottmann
Some smallish fixes to the (rnrs ...) modules. From: Andreas Rottmann Subject: Several fixes to R6RS libraries * module/rnrs/arithmetic/fixnums.scm (fixnum-width): Make this return an an exact integer instead of an inexact number. * module/rnrs/base.scm (assertion-violation): Implement

[PATCH] Add implementation of SRFI 27

2010-09-20 Thread Andreas Rottmann
Hi! Here's an updated version of the patch, this time with documentation: From: Andreas Rottmann Subject: Add implementation of SRFI 27 * module/srfi/srfi-27.scm: New file; implementation of SRFI 27 in terms of the existing random number generator. * module/Makefile.am (SRFI_SOURCES)

Bug in documentation for `load'?

2010-09-25 Thread Andreas Rottmann
d' is actually `load-module': % guile guile> load # % ~/.system/stow/guile-1.9.12/bin/guile ... scheme@(guile-user)> load $1 = # So, AFAICS, `load' uses the load paths (and only the load paths). Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: [PATCH] Add implementation of SRFI 27

2010-09-30 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Andreas Rottmann writes: > >> +...@c This subsection is based on the specification of SRFI-27, which has >> +...@c the following license: >> + >> +...@c Copyright (C) Sebastian Egner (2002). All Rights Reserved. > > Pe

[PATCH] Reference original specification in SRFI 27 documentation

2010-10-01 Thread Andreas Rottmann
From: Andreas Rottmann Subject: Reference original specification in SRFI 27 documentation * doc/ref/srfi-modules.texi (SRFI-27): Link to the original specification of SRFI-27. --- doc/ref/srfi-modules.texi |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc

[PATCH] Add implementation of SRFI 45

2010-10-03 Thread Andreas Rottmann
From: Andreas Rottmann Subject: Add implementation of SRFI 45 * module/srfi/srfi-45.scm: New file, containing the reference implementation of SRFI 45, slightly adapted to use SRFI-9. * module/Makefile.am (SRFI_SOURCES): Added srfi/srfi-45.scm. * test-suite/tests/srfi-45.test: New file

Re: [PATCH] Add implementation of SRFI 27

2010-10-03 Thread Andreas Rottmann
for example, the second part of the abstract and the rationale don’t >> belong in Guile’s manual), but having the code is nice too, so... > > Yes, having code is good. But really, we need code *and* > documentation. It should only take a couple hours or so, and it's really > appreciated. > OK, I'll see what I can do. Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

[PATCH] Extend the #:replace list of the SRFI 69 module

2010-10-24 Thread Andreas Rottmann
From: Andreas Rottmann Subject: Extend the #:replace list of the SRFI 69 module * module/srfi/srfi-69.scm: Add `make-hash-table' and `hash-table?' to the #:replace list of the module definition. --- module/srfi/srfi-69.scm |2 +- 1 files changed, 1 insertions(+), 1 deletion

R6RS exception printing at the REPL

2010-10-24 Thread Andreas Rottmann
p;message: "hey!" 4. &irritants: (1 2 3) Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> From: Andreas Rottmann Subject: Show R6RS exceptions in a reasonable way in the debugger * module/system/repl/error-handling/r6

[PATCH] Allow specifying load extensions on the command line

2010-10-25 Thread Andreas Rottmann
From: Andreas Rottmann Subject: Allow specifying load extensions on the command line Add a new command-line switch `-x', which manipulates the %load-extensions list. * libguile/script.c (scm_compile_shell_switches): Process the new "-x" switch. (scm_shell_usage): Mention

[PATCH] Use a fluid for the list of the reader's "hash procedures"

2010-10-25 Thread Andreas Rottmann
This is a prerequisite for the patch implementing SRFI-38, which I'll post next. From: Andreas Rottmann Subject: Use a fluid for the list of the reader's "hash procedures" This allows customizing the reader behavior for a dynamic extent more easily. * libguile/read.c (scm_

[PATCH] Add implementation of SRFI 38

2010-10-25 Thread Andreas Rottmann
From: Andreas Rottmann Subject: Add implementation of SRFI 38 * module/srfi/srfi-38.scm: New file, partly based on the reference implementation and on Alex Shinn's public-domain implementation for Chicken. * module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-38.scm. * test-suite/tests/sr

[PATCH] Some tweaks to the R6RS support

2010-10-26 Thread Andreas Rottmann
#x27;foo) (make-b-condition 'bar - (and (eq? (a-foo c) 'foo) (eq? (b-bar c) 'bar) + (and (eq? (a-foo c) 'foo) (eq? (b-bar c) 'bar + (pass-if "define-condition-type works for multiple fields" +(let ((c (condition (make-a-condition 'foo) +(make-c-condition 1 2 3 + (and (eq? (a-foo c) 'foo) + (= (c-baz c) 1) + (= (c-qux c) 2) + (= (c-frobotz c) 3) -- tg: (fe15364..) t/rnrs-tweaks (depends on: master) Regards, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Re: [PATCH] Use a fluid for the list of the reader's "hash procedures"

2010-10-28 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Hi! > > Thanks for the patch. > > Andreas Rottmann writes: > >> This is a prerequisite for the patch implementing SRFI-38, which I'll >> post next. >> >> >> From: Andreas Rottmann >> Subject

Re: [PATCH] Add implementation of SRFI 38

2010-10-28 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Hi Andreas! > > Andreas Rottmann writes: > >> +++ b/module/srfi/srfi-38.scm >> @@ -0,0 +1,203 @@ >> +;; Copyright (C) Andreas Rottmann 2010. > > Should be FSF. :-) > Fixed. >> +;; Copyright (C) Ray Dillin

[PATCH] Allow user-defined meta-commands

2010-10-31 Thread Andreas Rottmann
ontext of a specific module. * doc/ref/scheme-using.texi (Module Commands): Document the `in' meta-command. From: Andreas Rottmann Subject: Allow user-defined meta-commands Besides allowing user-defined meta-commands, this change also refactors the meta-command machinery to split reading

Re: Loading R6RS Libraries

2010-11-15 Thread Andreas Rottmann
es (rnrs base (6))) > (use-modules (rnrs base 6)) > That's to be expected -- `use-modules' has a different syntax than R6RS' `import'. So if you really want to include the version number, you should do either: (import (rnrs base (6))) or (use-modules ((rnrs base) #:version (6))) Cheers, Rotty -- Andreas Rottmann -- <http://rotty.yi.org/>

Some work on the R6RS I/O libraries

2010-11-15 Thread Andreas Rottmann
, call-with-output-file): Define these in terms of R6RS procedures to get correct exception behavior. From: Andreas Rottmann Subject: Some work on the R6RS I/O libraries Fix missing port-table locking and bytevector output port segfault. * libguile/r6rs-ports.c (make_bip, make_cbip, make

[PATCH 2/4] Add implementation of "transcoded ports"

2010-11-20 Thread Andreas Rottmann
* libguile/r6rs-ports.c (make_tp, tp_write, tp_fill_input, tp_flush, tp_close, initialize_transcoded_ports, scm_transcoded_port): New functions. (scm_init_r6rs_ports): Call `initialize_transcoded_ports'. * module/rnrs/ports.scm (transcoded-port): Remove, this is now implemented in C. * test

[PATCH 1/4] Fix missing port-table locking and bytevector output port segfault

2010-11-20 Thread Andreas Rottmann
* libguile/r6rs-ports.c (make_bip, make_cbip, make_bop, make_cbop): Lock the port table. * libguile/r6rs-ports.c (make_bop): Let the returned extraction procedure refer to the port's buffer instead of the port itself. This fixes a segfault if the port is closed before the extraction procedu

[PATCH 3/4] Reorganize the R6RS I/O condition types

2010-11-20 Thread Andreas Rottmann
Move the I/O condition types from `(rnrs conditions)', where they were not exported, to `(rnrs files)', where they are. * module/rnrs/conditions.scm: Remove definition of I/O condition types. * module/rnrs/files.scm: Replace references to I/O condition types inside `(rnrs conditions)' with the a

[PATCH 4/4] Work towards a more complete implementation of `(rnrs io ports)'

2010-11-20 Thread Andreas Rottmann
* module/rnrs/io/ports.scm: Change into an R6RS library from a "regular" Guile module, so the bookkeeping for #:re-export and #:replace is done automatically and we gain control over the imports from `(guile)'. (file-option, buffer-mode, eol-style, error-handling-mode, make-transcoder, nat

Re: [PATCH] Some tweaks to the R6RS support

2010-11-20 Thread Andreas Rottmann
Andy Wingo writes: > Hi Andreas, > > On Wed 27 Oct 2010 00:53, Andreas Rottmann writes: > >> * module/rnrs/base.scm (error, assert): Define -- they were missing. >> (assertion-violation): Properly treat a #f `who' argument. >> >> * module/rnrs/c

Re: R6RS exception printing at the REPL

2010-11-20 Thread Andreas Rottmann
Andy Wingo writes: > On Sun 24 Oct 2010 23:46, Andreas Rottmann writes: > >> Attached is a patch that improves the way R6RS exceptions are printed at >> the REPL > > Cool! I have also found the need to define pretty-printers for various > throw keys. I wonder, could y

[PATCH] Allow user-defined meta-commands (take #2)

2010-11-20 Thread Andreas Rottmann
uch a command, ",in" is added as a new meta-command. From: Andreas Rottmann Subject: Allow user-defined meta-commands Besides allowing user-defined meta-commands, this change also refactors the meta-command machinery to split reading a command's arguments from the procedure actually

Re: [PATCH 2/4] Add implementation of "transcoded ports"

2010-11-21 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes: > Hi! > > Andreas Rottmann writes: > >> * libguile/r6rs-ports.c (make_tp, tp_write, tp_fill_input, tp_flush, >> tp_close, initialize_transcoded_ports, scm_transcoded_port): New >> functions. >> (scm_init_r6rs_ports

[PATCH 1/4] Turn `(rnrs io ports)' into an R6RS library

2010-11-21 Thread Andreas Rottmann
* module/rnrs/io/ports.scm: Change into an R6RS library from a "regular" Guile module, so the bookkeeping for #:re-export and #:replace is done automatically and we gain control over the imports from `(guile)'. --- module/rnrs/io/ports.scm | 58 +++--

[PATCH 2/4] Reorganize the R6RS I/O condition types

2010-11-21 Thread Andreas Rottmann
Move the I/O condition types from `(rnrs conditions)', where they were not exported, to `(rnrs files)', where they are. * module/rnrs/conditions.scm: Remove definition of I/O condition types. * module/rnrs/files.scm: Replace references to I/O condition types inside `(rnrs conditions)' with the a

  1   2   3   >