<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel about="http://blog.gmane.org/gmane.lisp.scheme.gauche">
    <title>gmane.lisp.scheme.gauche</title>
    <link>http://blog.gmane.org/gmane.lisp.scheme.gauche</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1216"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1215"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1214"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1213"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1212"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1211"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1210"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1209"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1208"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1207"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1206"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1205"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1204"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1203"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1202"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1201"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1200"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1199"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1198"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1197"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1216">
    <title>[ANN] GaUnit 0.1.6</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1216</link>
    <description>Hi,

I've released GaUnit 0.1.6:
  http://www.cozmixng.org/~rwiki/?cmd=view;name=GaUnit
  http://www.cozmixng.org/~kou/download/gaunit-0.1.6.tar.gz

GaUnit is a xUnit based unit testing framework for Gauche.


! How to write?

gauche.test:

  (test "add" 3 (lambda () (+ 1 2)))
  (test "sub" -1 (lambda () (- 1 2)))

GaUnit:

  (define (test-add)
    (assert-equal 3 (+ 1 2)))

  (define (test-sub)
    (assert-equal -1 (- 1 2)))

! Output example

A failure test derived from test/string.scm in the Gauche
repository with a small change (bar -&gt; baz):

gauche.test:
  (test* "string-join" "foo::baz::baz"
         (string-join '("foo" "bar" "baz") "::"))

GaUnit:
  (define (test-string-join)
    (assert-equal "foo::baz::baz"
                  (string-join '("foo" "bar" "baz") "::")))

Here is output:

gauche.test:
  test string-join: expects "foo::baz::baz" =&gt; got "foo::bar::baz"

GaUnit:
    1) Failure: test-string-join
  ./test-string.scm:4: (assert-equal "foo::baz::baz" (string-join '("foo" "bar" "baz") "::"))
  expected: &lt;"foo::baz::baz"&gt;
   but was: &lt;"foo::bar::baz"&gt;


gauche.test's output is compact.

GaUnit's output is verbose. It includes the followings:

  * stack trace with Emacs friendly format
  * aligned expected and actual value output for easy comparable
  * (diff if it is needed)

Why is GaUnit's failure report verbose? It's for easy
debugging.


Thanks,
--
kou

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Kouhei Sutou</dc:creator>
    <dc:date>2008-10-22T13:06:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1215">
    <title>Re: 0.8.14 FFI changes</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1215</link>
    <description>I'm not aware of any library-level API incompatibility in 0.8.14.
The binary structure layout has been changed, as usual, so you need
to recompile the stuff (the generated C files from 'stub' files
have been changed, so you should build from clean state).

But if you get an error even after that, could you describe 
some more concrete example where the incompatibility araises?
I might have overlooked something.

--shiro


From: "Bill Schottstaedt" &lt;bil&lt; at &gt;ccrma.Stanford.EDU&gt;
Subject: [Gauche-devel] 0.8.14 FFI changes
Date: Mon, 13 Oct 2008 15:20:21 -0700


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Shiro Kawai</dc:creator>
    <dc:date>2008-10-13T23:25:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1214">
    <title>0.8.14 FFI changes</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1214</link>
    <description>I moved to 0.8.14 today, and all my stuff immediately segfaults.
Is there a list somewhere of the changes in this version as relates to
foreign code?  For example, optional arguments to a foreign function
trigger a "wrong number of arguments" error.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Bill Schottstaedt</dc:creator>
    <dc:date>2008-10-13T22:20:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1213">
    <title>ANN: dyncomp 0.2.0</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1213</link>
    <description>Hi all.

dyncomp 0.2.0 is released.

dycomp is a module that enables to create C function with
gauche.cgen.cise (C in S expression). This function is compiled to
native code with Tiny C Compiler (http://bellard.org/tcc/), so you can
create a fast function.

The change from the previous version is:
    - Gauche module has bindings of C symbols, so different gauche  
modules can associate different binding to the same C symbol.
    - Added some macros (define-cfn, dyncomp-reset!).

See http://homepage.mac.com/naoki.koguro/prog/dyncomp/index.html for
more details.

--
KOGURO, Naoki &lt;naoki&lt; at &gt;koguro.net&gt;


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>KOGURO, Naoki</dc:creator>
    <dc:date>2008-10-11T12:19:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1212">
    <title>Release 0.8.14</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1212</link>
    <description>Gauche 0.8.14 is available.

 http://practical-scheme.net/gauche/

This release is to flush out cumulative bug fixes and small
improvements.  Nothing particularly shiny, but the performance is
also slightly improved, so you might want to upgrade.

In SVN trunk there's a module parser.peg, a parser combinator library
for parsing expression grammar.   It is NOT included in this release.
I want it be the default choice of the parser of Gauche, and not
satisfied by the current implementation.  You may try it from svn,
but be aware that the API will be changed a lot in future.

Some suggested changes are not incorporated due to the lack of
the time of testing, including Tomas Stanek's suggestion of using
USE_MMAP in GC.

It's been over 4 years since Gauche reached 0.8.  It's not that
the development is slowed down; in fact a lot of code has been
added or rewritten since then.  These days I get more and more
opportunities to use Gauche in real work, and keep adding
stuff that are required in the production environment.  During
the course, I started to feel to adjust the original plan 
a little bit, though.

Originally I wanted to fix C ABI by 0.9, so that after 1.0 you
don't need to recompile every extensions for each new release
of Gauche.  However the goal seems further than I thought, mainly
because improvements in various parts (including VM) tend to
require API change.  I also start to think that it won't be
that bad to recompile extensions, for the job can be largely
automated by clever package management system.

On the other hand, from the production application I feel the
need to work more on the domain of debugging, performance tuning,
and better deployment machinery.

So I decided to put off C ABI fix after 1.0; I aim at releasing
0.9 as the wrap up of all those extensions of 0.8.x series,
then start concentrating more on the 'production friendly'
region.  Well it's just a plan so I might adjust it again, but
this is what I have in mind currently.

--shiro






-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Shiro Kawai</dc:creator>
    <dc:date>2008-10-07T14:35:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1211">
    <title>Re: garbage collector issues</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1211</link>
    <description>
Is this branch already available, or will this technique be used in
future releases of gauche? I would especially be interested if there
would be some relatively cheap technique (similar to integer shifting)
which would distinguish those doubles from potential pointers.



Yes, it's the latter. It is bounded, but in my case, the bounds heavily
depend on those larger blocks rather than structures like queues etc.
I've tried playing with those intermediate structures with virtualy no
effect on the problem. Also, when I looked on GC_Dump, almost all used
memory was in a large amount of free lists. 
It seems to me, that the problem is sort of still there even when 
-DUSE_M[UN]MAP is used, because GC still keeps those free lists. The
corresponding pages are however ramapped as PROT_NONE (and potentialy 
mapped back later), so the overhead of "fragmented free heap" stays 
mainly in GC's internal structures and OS memory maps, which is 
relatively low.


Best regards,
Tomas Stanek

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Tomas Stanek</dc:creator>
    <dc:date>2008-09-04T11:54:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1210">
    <title>Re: garbage collector issues</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1210</link>
    <description>Thanks, Tomas.

From: Tomas Stanek &lt;sad0ur&lt; at &gt;psi.cz&gt;
Subject: [Gauche-devel] garbage collector issues
Date: Thu, 4 Sep 2008 12:05:44 +0200


I think you're correct.  It doesn't need to be SCM_NEW
(technically ScmFlonum has a pointer to the &lt;flonum&gt; class, but
it is allocated staticallly and will never be GCed, so we don't
need to consider it.)

In a branch of the source tree I implemented a different treatment
of flonums, in which ScmFlonum is only 8 bytes (it's just double).
It also uses a sort of specialized generational GC to reduce overhead
of ephemeral flonums.  (The detail is in my DLS2008 paper which will
be available on ACM site sometime in future).


Good suggestion.  

We need to watch two numbers w.r.t memory consumption:

(1) Does the value grows over time without bound?  Then it
is a leak, and one likely cause would be false pointers.
Especially you need to watch out non weak-GC-robust data
structures such as queues.

(2) If it isn't a leak, still the absolute amount of memory
could be a problem, if there exists unnecessary large overhead.
A likely cause would be fragmentation of relatively large
blocks.

I assume what you're observing is the latter.
You may be able to get some clue by setting GC_PRINT_STATS 
environment variable.  Anyways, using mmap option seems
worth looking.   Thanks again for reporting this.

--shiro


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Shiro Kawai</dc:creator>
    <dc:date>2008-09-04T10:58:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1209">
    <title>garbage collector issues</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1209</link>
    <description>Hello,

I've encountered quite large memory consumption of gauche under some
circumstances. My program reads an xml document, converts it into a tree
with lots of flonums (sometimes about 20000), do some work with it and 
continues to another document. The program also allocates few large 
(up to a megabyte) blocks and lot of pairs/flonums/etc during each 
iteration.

Problem is, that it's memory consuption grows up to 200 - 300MB and 
never goes down.

I've noticed two things...

First,
Scm_MakeFlonum uses SCM_NEW (not SCM_NEW_ATOMIC) for allocation of the 
ScmFlonum, which is pointer free. I expectd this to be a "typo".

Changing SCM_NEW to SCM_NEW_ATOMIC improves the situation a bit, but 
not as much.


Second,
Boehm Weiser GC is by default configured not to use -DUSE_MMAP
and -DUSE_MUNMAP flags. This way, GC doesn't ever return allocated
memory to the operating system.

By using -DUSE_MMAP and -DUSE_MUNMAP, memory consumption keeps around
20 - 30MB. I'm not sure why -DUSE_M[UN]MAP makes a such difference. My
speculation is that GC's freelists are poluted with large blocks which
are not very usable for future allocations and GC tends to grow heap.

My second point is just a remark and maybe suggestion that -DUSE_M[UN]MAP
could be useful as gauche's compile-time option.

Best regards,
Tomas Stanek

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Tomas Stanek</dc:creator>
    <dc:date>2008-09-04T10:05:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1208">
    <title>Re: Connecting 2 processes by a pipe</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1208</link>
    <description>From: "Stas Boukarev" &lt;stassats&lt; at &gt;gmail.com&gt;
Subject: [Gauche-devel] Connecting 2 processes by a pipe
Date: Fri, 29 Aug 2008 00:55:22 +0400


The general way is a bit cumbersome in the current Gauche.
If you're looking for a quick way, delegating the piping
work to the shell is the easiest.  For example:

  (process-output-&gt;string "cat file | wc -l")

If you don't want shell to be involved, you have to do the job
what shells are doing: Create pipes and connect the processes
with them.  The high-level process interface doesn't help much,
unfortunately.  This is a quick sample I typed in my REPL:

gosh&gt; (receive (i0 o0) (sys-pipe)
        (receive (i1 o1) (sys-pipe)
          (let ((p1 (sys-fork-and-exec "cat" '("cat" "configure")
                                       :iomap `((1 . ,o0) (2 . 2))))
                (p2 (sys-fork-and-exec "wc" '("wc" "-l")
                                       :iomap `((0 . ,i0) (1 . ,o1) (2 . 2)))))
            (close-output-port o0)
            (close-output-port o1)
            (read-line i1))))
"2625"

Basically, what it does is to connect processes using two pipes:

  cat -&gt; o0==pipe==i0 -&gt; wc -&gt; o1==pipe==i1 -&gt; read-line

There are a few caveats.  Don't forget to close o0, otherwise 'wc'
will keep waiting for input even 'cat' is done its job (because, if
you keep o0 open, it effectively becomes a 'Y' pipe with two entrance.)

Also, strictly speaking, you have to call sys-waitpid on p1 and p2
to collect exit status, otherwise they become zombies.
(In practice, if your script is not long-running, you can leave
them alone and the system will collect them after your script exits).

Scsh has a nice high-level interface that automates these 
under-the-hood wirings, and I have a plan to port it to Gauche.

--shiro






-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Shiro Kawai</dc:creator>
    <dc:date>2008-08-28T22:19:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1207">
    <title>Connecting 2 processes by a pipe</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1207</link>
    <description>How one can connect two processes by a pipe like "cat file | wc -l"?
I read "9.16 gauche.process" section of the manual but still can't get it.

</description>
    <dc:creator>Stas Boukarev</dc:creator>
    <dc:date>2008-08-28T20:55:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1206">
    <title>Re: expt hangs</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1206</link>
    <description>From: "Bill Schottstaedt" &lt;bil&lt; at &gt;ccrma.Stanford.EDU&gt;
Subject: [Gauche-devel] expt hangs
Date: Sat, 9 Aug 2008 12:52:15 -0700


Not exactly.  It just takes long to calculate.

gosh&gt; (time (begin (expt 1/500029 362880/3) #t))
;(time (expt 1/500029 120960))
; real   9.364
; user   9.340
; sys    0.000
#t

But more importantly, it takes way too long to *print* it.
Note that you're asking exact calculation.  The result
will be something like:

   1/........huge_number.........

The denominator will be about 690000 digits long.
Converting bignum binary to decimal involves lots of
divisions of bignums.

Exact numeric arithmetics is not in Gauche's emphasis; it
uses n^2 algorithm for bignum multiplication and division,
so the performance deteriorates quickly if the number gets
huge.   The question is, do you need exact calculation here?

--shiro





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Shiro Kawai</dc:creator>
    <dc:date>2008-08-09T21:15:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1205">
    <title>expt hangs</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1205</link>
    <description>I think the expression (expt 1/500029 362880/3) causes Gauche to hang.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Bill Schottstaedt</dc:creator>
    <dc:date>2008-08-09T19:52:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1204">
    <title>Re: write-object from write vs. from display</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1204</link>
    <description>From: "Leonardo Boiko" &lt;leoboiko&lt; at &gt;gmail.com&gt;
Subject: Re: [Gauche-devel] write-object from write vs. from display
Date: Tue, 29 Jul 2008 19:57:25 -0300


That was the original plan.  The problem is this: It is quite
common to call 'format' from write-object, but there's no way
to pass the mode info to 'format'.

(define-method write-object ((obj &lt;my-object&gt;) port mode)
  (format port "...." ...))

We can add a new function, say 'format/mode' and 'format/ss/mode',
that takes extra mode argument.  But we can't save the existing
write-object methods that are using standard 'format'---it means
for any recursive structure, we can't rely on the mode argument to 
propagate down.  With the parameter approach, we don't need to
worry about propagation part.

--shiro

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Shiro Kawai</dc:creator>
    <dc:date>2008-08-02T03:36:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1203">
    <title>Re: write-object from write vs. from display</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1203</link>
    <description>Thanks for the attention Shiro, I'll wait more then to see how it will
turn out then.  I'm serializing the objects of my game's world with
write-object plus srfi10 read-time constructors (via a simple generic
printer/constructor for arbitrary gauche classes; dunno if someone
tried this already?) — so far I didn't notice any problems, but then
I'm not using shared/nested structures.


2008/7/29 Shiro Kawai &lt;shiro&lt; at &gt;lava.net&gt;:

I still don't get it; will the user ever need to set the write-mode?
If not, wouldn't it be simpler to just make write-object receive two
arguments, the object and the write-mode?
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
_______________________________________________
Gauche-devel mailing list
Gauche-devel&lt; at &gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gauche-devel
</description>
    <dc:creator>Leonardo Boiko</dc:creator>
    <dc:date>2008-07-29T22:57:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1202">
    <title>Re: write-object from write vs. from display</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1202</link>
    <description>From: "Leonardo Boiko" &lt;leoboiko&lt; at &gt;gmail.com&gt;
Subject: Re: [Gauche-devel] write-object from write vs. from display
Date: Tue, 29 Jul 2008 18:16:24 -0300


The bottom problem is that the current write-object API is broken;
it's not only about write/display distinction.  There's another
special circumstances when write-object is called, one of which is
the 'walk' stage of write/ss and format/ss (I omit lengthy
explanation here, but the point is that currently I use nasty duct-
taping to hide this case, which may break in some edge cases).
Realizing generic pretty-printer also requires the context information.

I've been thinking how to support this context problem without
changing the current API drastically.  I think the best way, from
the user's point of view, is using dynamic parameters.  Since
you brought up the topic, it may be a good time to hammer out
the concrete implementation.

How about this.  In your write-object method you can call write-mode
procedure that returns a symbol indicating which mode it is called.

  (write-mode) =&gt; a symbol

The symbol may be one of the followings:

  write   - called from write, or ~s directive of format
  display - called from display, or ~a directive of format
  walk    - a special 'walk' pass from write/ss or format/ss.

In the 'walk' mode usually you can do the same thing as you do in
'write' mode, but there are certain things you may want to
avoid.  I'll elaborate it when I write down the reference.

There are other context information to be passed around, but I
think this API won't conflict with future development.

--shiro




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/_______________________________________________
Gauche-devel mailing list
Gauche-devel&lt; at &gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gauche-devel
</description>
    <dc:creator>Shiro Kawai</dc:creator>
    <dc:date>2008-07-29T22:02:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1201">
    <title>Re: write-object from write vs. from display</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1201</link>
    <description>
That's a bit over my level… If I just patched in a display-object
method (defaulting to write-object) and made display use it, would you
accept? =)
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
_______________________________________________
Gauche-devel mailing list
Gauche-devel&lt; at &gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gauche-devel
</description>
    <dc:creator>Leonardo Boiko</dc:creator>
    <dc:date>2008-07-29T21:16:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1200">
    <title>Re: write-object from write vs. from display</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1200</link>
    <description>Right now there's no way to distinguish them.  
I've been planning to replace the object write protocol to passing
around context information (including write/display distinction).

--shiro



From: "Leonardo Boiko" &lt;leoboiko&lt; at &gt;gmail.com&gt;
Subject: [Gauche-devel] write-object from write vs. from display
Date: Tue, 29 Jul 2008 12:33:04 -0300


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Shiro Kawai</dc:creator>
    <dc:date>2008-07-29T21:10:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1199">
    <title>write-object from write vs. from display</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1199</link>
    <description>Hi.  According to gauche manual,

     When `write' and `display' encounter an object of a user-defined
     class, they call the generic function `write-object'.

The same generic is called for both methods? How do I make my objects
react differently to 'write' and 'display'?

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Leonardo Boiko</dc:creator>
    <dc:date>2008-07-29T15:33:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1198">
    <title>Re: c-wrapper doesn't play with the module system?</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1198</link>
    <description>2008/7/29 KOGURO, Naoki &lt;naoki&lt; at &gt;koguro.net&gt;:

Aaah I see now.  Thanks :)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Leonardo Boiko</dc:creator>
    <dc:date>2008-07-29T13:12:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1197">
    <title>Re: c-wrapper doesn't play with the module system?</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1197</link>
    <description>Hi Leonardo,

On 2008/07/29, at 11:18, Leonardo Boiko wrote:


Without c-wrapper, this happens.
gosh&gt; (define (filter) #f)
filter
gosh&gt; (use gauche.collection)
#&lt;undef&gt;
gosh&gt; filter
#&lt;closure filter&gt;
gosh&gt; (filter (lambda (i) (lisp? i)) '(a b c))
*** ERROR: wrong number of arguments for #&lt;closure filter&gt; (required  
0, got 2)

It seems to me that Gauche searches a binding in a current module  
first, then searches a binding in imported modules.
c-wrapper defines symbols in a current module, so ncursesw's filter  
defined by c-wrapper is used, I think.

If you avoid this case, define a module for ncursesw.

;;; the module for ncursesw
(define-module my-curses
   (use c-wrapper)

   (export ncursesw-filter
           &lt;&lt; add symbols you need &gt;&gt;)
   )

(select-module my-curses)

(c-load-library "libncursesw")
(c-include "ncursesw.h")

(define ncursesw-filter filter)

(provide "my-curses")


;;; main program
(use my-curses)
(use gauche.collection)

(filter (lambda (i) (lisp? i)) '(scheme ruby cl haskell lolcat))))
(ncursesw-filter)

--
KOGURO, Naoki &lt;naoki&lt; at &gt;koguro.net&gt;


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>KOGURO, Naoki</dc:creator>
    <dc:date>2008-07-29T12:59:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.scheme.gauche/1196">
    <title>c-wrapper doesn't play with the module system?</title>
    <link>http://permalink.gmane.org/gmane.lisp.scheme.gauche/1196</link>
    <description>Hi.  Sorry if this is a frequent question, but I couldn't find info.
I'm using ncursesw with c-wrapper like this:

  (use c-wrapper)
  (c-load-library "libncursesw")
  (c-include "ncursesw/curses.h")
  […]
  (use gauche.collection)

From the way the module system works, I'd expect a symbol exported by
both the C libs and the "collection" module to be bound to the module
in the last "use" clause, but these aren't the results I get:

  gosh&gt; filter
  #&lt;closure (make-c-func loop239)&gt;
  gosh&gt; (with-module gauche.collection filter)
  #&lt;generic filter (2)&gt;
  gosh&gt; (filter (lambda (i) (lisp? i)) '(scheme ruby cl haskell lolcat))))
  *** ERROR: wrong number of arguments: filter requires 0, but got 2
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
_______________________________________________
Gauche-devel mailing list
Gauche-devel&lt; at &gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gauche-devel
</description>
    <dc:creator>Leonardo Boiko</dc:creator>
    <dc:date>2008-07-29T02:18:04</dc:date>
  </item>
  <textinput about="http://search.gmane.org/?group=$group=gmane.lisp.scheme.gauche">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.lisp.scheme.gauche</link>
  </textinput>
</rdf:RDF>
