repl, abridged output?

2012-12-03 Thread Daniel Llorens

Hello,

When I work with large arrays or other large data structures on the command 
line, I have to be careful not to print them. Guile always prints these things 
in full, it takes forever and often I can't even C-c.

I've seen that there's a REPL command ,inspect that produces abridged output. 
Is it possible to have this as the default for printing to the REPL? Is there 
any way to configure this?

Thanks,

Daniel




IXIN 1.2 available

2012-12-03 Thread Thien-Thi Nguyen
release notes:

  One bugfix, some new features, and more detailed ‘meta’ spec.
  BTW, ‘a2ixin foo.sxml’ works fine under Guile 2.
  Getting the .sxml in the first place is the problem, there.

  thi

README excerpts:

  IXIN is an EXPERIMENTAL distribution of EXPERIMENTAL code and
  some pre-built IXIN files.  IXIN stands for "indexed texinfo".

  All code is under GPLv3+.  All (.xml) docs are under GFDL.

  [...]

  It defines a documentation file format and provides two simple
  tools to write and read, respectively, files in that format.

NEWS excerpt:

  - 1.2 | 2012-12-03

- bugfix: use ‘pretty-print’ also for index

Previously, a node name could be incorrectly written in the index
due to the lameness of ‘object->string’ (mentioned in release 1.1).
You can see this by copying new file prob.xml into the previous
release and running "make prob.ixin".  Contrast to the prob.ixin
distributed in this release.

- new retrieve command: dump-node

This displays the raw node data for a selected node to stdout.
To get the tree, do: ‘./retrieve ... | base64 -d | gzip -d’.

- new retrieve command: repl

This runs a simple command loop that reads from stdin and writes to
stdout.  The program maintains a "current node", and recognizes
some simple navigation and display commands.  Type ‘quit’ to quit.

To see this in action, try "make demo-zow".  Add ‘ZOW=rcs’, e.g.,
to choose rcs.ixin (defaults to alive.ixin if not specified).

- ‘meta’ format defined

Previously, it was simply the portion of the (input) SXML prior to
the first ‘node’ element.  Now, it has the form:

(ATTRS XID VARS SETTINGS COPYING TITLEPAGE ELEMENT...)

This change is a move from underspecified to specified, so the
version number of the format remains at 1.  See README.

tarball, etc, in dir:

  http://www.gnuvola.org/software/ixin/

atom feed:

  http://www.gnuvola.org/NEWS.atom

-- 
Thien-Thi Nguyen . GPG key: 4C807502
.  NB: ttn at glug dot org is not me   .
. (and has not been since 2007 or so)  .
.ACCEPT NO SUBSTITUTES .
... please send technical questions to mailing lists ...


pgptMl5GfTlD4.pgp
Description: PGP signature


Environments

2012-12-03 Thread Sjoerd van Leent Privé

Hi Everyone,

What I like to do is to let the user give a "driver" library and pass 
that "driver" library around which implements a certain procedure. Using 
the eval procedure together with a small instruction and a ad-hoc 
generated environment would let the software be pretty free of things 
flying around with ill side-effects. Anyone an idea how I could do this 
in a portable way?


I have been trying to do this using the construct (environment, 
/import-spec/), however, this doesn't appear to include the default 
things which the "guile" library provides (such as quote, unquote, 
quasiquote and the likes). When using the (scheme-report-enviroment 5), 
it appears not to be possible to pass along additional import-spec elements.


I know it is possible to pass "guile" along, however, this is not very 
elegant in portability.


Also, I would like the environment to be destroyed afterwards (as I 
don't want the environment to leak unwanted side-effects).


Anyone an idea about how to do this?

Thanks in advance,
Sjoerd


Re: repl, abridged output?

2012-12-03 Thread Daniel Hartwig
On 3 December 2012 20:39, Daniel Llorens  wrote:
> I've seen that there's a REPL command ,inspect that produces
> abridged output. Is it possible to have this as the default for
> printing to the REPL? Is there any way to configure this?

scheme@(guile-user)> (eval '(set! repl-print
  (lambda (repl val)
(if (not (eq? val *unspecified*))
(begin
  (run-hook before-print-hook val)
  (format #t "~20@y" val)
  (newline)
   (resolve-module '(system repl common)))
scheme@(guile-user)> (use-modules (srfi srfi-1))
scheme@(guile-user)> (iota 500)
$1 = (0 1 2 3 4 5 6 7 …)



[ANN] guile-colorized released!

2012-12-03 Thread nalaginrut
hi folks!
Here is the project to colorize Guile REPL:
https://github.com/NalaGinrut/guile-colorized
Play it according to README. 
Attached a screen shot for the effect.
Enjoy it!

And it uses 'before-print-hook', Daniel posted a patch to add REPL
optional printer in another thread.
I'll update my project for this after that patch is accepted, and format
a patch.

PS: Though I've tested it, but maybe bugs remain. 
Both bug-report/patches/suggestion are welcome, thanks!

Happy hacking!

<>