Re: [Chicken-users] chicken-setup broken

2008-03-06 Thread Jim Ursetto
Ivan,

Installation of downloaded eggs now works.

However, installing an egg located in the current directory
still fails, with a different path in the error.

[EMAIL PROTECTED] ~$ ll objc.egg
-rw-r--r--   1 root  jim  64708 Jan 14 01:00 objc.egg

[EMAIL PROTECTED] ~$ sudo chicken-setup objc
Error: (open-input-file) can not open file - No such file
  or directory: "objc.egg"


On 3/6/08, Ivan Raikov <[EMAIL PROTECTED]> wrote:
>
> Hi Jim,
>
> Can you try r9257? I have committed some fixes to chicken-setup
> that would hopefully solve your problems.

> "Jim Ursetto" <[EMAIL PROTECTED]> writes:

> > -- Install of egg located in current directory fails:
> >
> > [EMAIL PROTECTED] ~$ echo $TMPDIR $CHICKEN_TMPDIR
> >
> > [EMAIL PROTECTED] ~$ ll objc.egg
> > -rw-r--r-- 1 root jim 64708 Jan 14 01:00 objc.egg
> > [EMAIL PROTECTED] ~$ sudo chicken-setup objc
> > Error: (open-input-file) can not open file - No such file or
> > directory: "/tmp/chicken-setup-3-root/downloads/objc.egg"


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Revised Chapter 1 (reminder)

2008-03-06 Thread Vincent Manis

On 2008 Mar 06, at 21:22, John Cowan wrote:





Quite so, which is why I'd suggest that the msys version be scrapped
and that everyone on Windows use either the cygwin or the mingw  
version.
Well, I actually don't care one way or the other. I'll change the  
documentation

if a consensus emerges.

-- v


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] chicken-setup broken

2008-03-06 Thread Ivan Raikov

Hi Jim,

   Can you try r9257? I have committed some fixes to chicken-setup
that would hopefully solve your problems. 

   -Ivan

"Jim Ursetto" <[EMAIL PROTECTED]> writes:

> Hi,
>
> chicken-setup seems to be broken (r9210).
>
> --  Install of egg located in current directory fails:
>
> [EMAIL PROTECTED] ~$ echo $TMPDIR $CHICKEN_TMPDIR
>
> [EMAIL PROTECTED] ~$ ll objc.egg
> -rw-r--r--   1 root  jim  64708 Jan 14 01:00 objc.egg
> [EMAIL PROTECTED] ~$ sudo chicken-setup objc
> Error: (open-input-file) can not open file - No such file or
> directory: "/tmp/chicken-setup-3-root/downloads/objc.egg"
>
> --  Install of downloaded egg fails:
>
> [EMAIL PROTECTED] ~$ sudo chicken-setup hostinfo
> The extension hostinfo does not exist.
> Do you want to download it ? (yes/no/abort) [yes] yes
> downloading hostinfo.egg from (www.call-with-current-continuation.org
> eggs/3 80)
> Error: (open-input-file) can not open file - No such file or directory:
> "/tmp/chicken-setup-3-root/downloads/tmp/chicken-setup-3-root/downloads/hostinfo...


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Revised Chapter 1 (reminder)

2008-03-06 Thread John Cowan
Vincent Manis scripsit:

> John Cowan asked what the point of having both flavors. Back when I
> was doing Windows stuff, I normally built things via bash scripts
> (just as I do today on OSX). I did use MinGW/MSys (curse their
> weird capitalization) for exactly that, once or twice. But most of
> my coworkers were kind of locked into Windows, and trying to explain
> shell scripts to them would have been very stressful on all of us. So
> had I been building something for them to use, I probably would have
> created a batch file for building it, on the grounds that they would
> be more likely to understand it than a shell script.

Quite so, which is why I'd suggest that the msys version be scrapped
and that everyone on Windows use either the cygwin or the mingw version.

-- 
Andrew Watt on Microsoft:   John Cowan
Never in the field of human computing   [EMAIL PROTECTED]
has so much been paid by so manyhttp://www.ccil.org/~cowan
to so few! (pace Winston Churchill)


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] srfi-29 egg problems: [EMAIL PROTECTED] doesn't seem to work?

2008-03-06 Thread Robin Lee Powell
On Thu, Mar 06, 2008 at 09:46:49AM +0100, felix winkelmann wrote:
> 
> You need a version of "format" that is more capable than the
> builtin one (which builds on [sf]printf). Install "format-modular"
> or "format", and load that before srfi-29.

Did that; now I get:

Error: (vector-ref) out of range
#("12:00" "Fred")
2

Call history:

(localized-message (quote goodbye) myname)
(quote goodbye)
(display #\newline)
  (display (localized-message (quote time) "12:00" 
myname))
  (localized-message (quote time) "12:00" myname)
  [localized-message] (apply format (cons 
(localized-template (quote hello-program) message-name) args))
  [localized-message] (cons (localized-template (quote 
hello-program) message-name) args)
  [localized-message] (localized-template (quote 
hello-program) message-name) <--

Code attached.  Not that it matters, as srfi-29 isn't sufficient for
me (see
http://search.cpan.org/~petdance/Locale-Maketext-1.12/lib/Locale/Maketext/TPJ13.pod
) but now I'm curious.  :)

-Robin


-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
(require-extension format-modular)
(require-extension srfi-29)

(let ((translations
   '(((en) . ((time . "Its ~a, ~a.")
(goodbye . "Goodbye, ~a.")))
 ((fr) . ((time . "[EMAIL PROTECTED], c'est ~a.")
(goodbye . "Au revoir, ~a."))
  (for-each (lambda (translation)
  (let ((bundle-name (cons 'hello-program (car translation
 (declare-bundle! bundle-name (cdr translation
 translations))

(define localized-message
  (lambda (message-name . args)
(apply format (cons (localized-template 'hello-program
message-name)
args

(current-language 'fr)
(let ((myname "Fred"))
  (display (localized-message 'time "12:00" myname))
  (display #\newline)

  (display (localized-message 'goodbye myname))
  (display #\newline))
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] google summer of code

2008-03-06 Thread Alex Shinn
> "Alaric" == Alaric Snell-Pym <[EMAIL PROTECTED]> writes:

Alaric> I'm also keen on a proper library/module system,
Alaric> though. I'd like to be able to use multiple
Alaric> macro systems in the same source file, for a
Alaric> start. So something where chicken itself has a
Alaric> notion of a macro environment, and macro systems
Alaric> just register closures in an alist or whatever
Alaric> that (define-syntax ...) dispatches on to
Alaric> convert whatever the user supplies into a
Alaric> closure that rewrites syntax objects, then when
Alaric> the macro is invoked, that closure can be
Alaric> applied to perform the rewrite. Then the module
Alaric> system needs to know that there are two
Alaric> environments - values and syntax - to expose
Alaric> from modules and import into places, and all
Alaric> should be well. Surely?

Actually, that would be far more work than I'd be interested
in.  The different macro systems all have their own
representations of hygiene information, and getting them all
to work together would be a pain.

What I would probably end up doing is choosing a single
macro system to be required for the module system.  Probably
riaxpander because Taylor Campbell will actively support it
and it already handles syntax-rules, syntactic-closures and
explicit renaming.  Implementing syntax-case on top of it
wouldn't be much work either if people really, honestly felt
they wanted that (except identifier-syntax - it would be
easy enough for someone else to add but I couldn't bring
myself to dirty the macro semantics so badly).

Though if people want syntax-case I'd like some rationale
before working on it, and clear reasons as to why they don't
like the more straightforward alternatives.

Again, interoperability with non-module eggs is an important
goal, so this wouldn't affect any existing eggs.

-- 
Alex


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Anyone working on a BDD framework?

2008-03-06 Thread Robin Lee Powell

I'm a big fan of rspec/jbehave/etc's "Given/When/Then" framework for
doing BDD specifications.  Before I go off and write my own (read:
before I hack testbase to do it), has anyone already got such a
thing for Chicken I can use?

-Robin

-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Revised Chapter 1 (reminder)

2008-03-06 Thread Vincent Manis

On 2008 Mar 06, at 09:08, Ashley Bone wrote:
I'd suggest combining the paragrapsh on the MinGW/msys builds and  
just noting that makefiles exist for cmd.exe and msys.

Done.

John Cowan asked what the point of having both flavors. Back when I  
was doing
Windows stuff, I normally built things via bash scripts (just as I do  
today
on OSX). I did use MinGW/MSys (curse their weird capitalization) for  
exactly
that, once or twice. But most of my coworkers were kind of locked into  
Windows,
and trying to explain shell scripts to them would have been very  
stressful
on all of us. So had I been building something for them to use, I  
probably
would have created a batch file for building it, on the grounds that  
they

would be more likely to understand it than a shell script.

So my vote (even though I have no machines at present that need or  
even could

use MinGW) goes to keeping both.

-- v


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Revised Chapter 1 (reminder)

2008-03-06 Thread Ashley Bone

John Cowan wrote:

Ashley Bone scripsit:


The mingw and mingw-msys builds are pretty much the same.  Both give
you a chicken built against the mingw headers and import libraries.
The only difference is the environment where you actually run make.
Makefile.mingw is can be used in cmd.exe with the version of make
that comes with mingw.  Makefile.mingw-msys requires the msys shell
since it uses unix command (cp, rm, etc).  The end product is the
same.


So in that case what use is the mingw-msys build?

I had thought that the result of the mingw-msys build was code parts of
which (chicken-setup, chicken-bug, or whatever) could only be used if
msys was present at run time.  If that's not the case, it seems pointless
to maintain both builds, since anyone with or without msys can use the
mingw build.


The only advantage I can see is that if you use msys you don't have to
fiddle with the windows command shell.  I'm not sure Makefile.mingw
will work in msys because some of the unix utilities like mkdir are
actually built-in commands in cmd.exe so they are treated a little
differently in the plain mingw build.

ashley


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Web generation + localization.

2008-03-06 Thread Robin Lee Powell
On Thu, Mar 06, 2008 at 10:22:32AM +0100, Peter Bex wrote:
> I've spent a bit of time thinking about this (unfortunately, no
> time to code it up yet).  At work we use Drupal, which simply
> requires you to wrap translatable strings with a function call to
> t(...). This is a solution that absolutely does not scale well
> because everytime it sees a t() call, it hits the database to
> retrieve the string. It caches pages, but still we see a lot of
> overhead in the roundtrips to the database for uncached pages.

Beyond not scaling well, that approach is flawed from the get-go;
see
http://search.cpan.org/~petdance/Locale-Maketext-1.12/lib/Locale/Maketext/TPJ13.pod

I'm planning on writing a maketext-alike for Chicken.

That's somewhat a seperate issue, however.  I was planning on using
backing files rather than a database, but your (snipped) point about
going to the backing source (whatever it happens to be) as few times
as possible is a good one; thanks.

-Robin

-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] eggs unlimited 3

2008-03-06 Thread Robin Lee Powell
Thank you!

Now who can fix callcc.org to point to it?  :D

-Robin

On Thu, Mar 06, 2008 at 03:16:55PM +0900, Ivan Raikov wrote:
> 
>   I have created a symbolic link that points to Eggs Unlimited 3. 
> 
> -Ivan
> 
> Robin Lee Powell <[EMAIL PROTECTED]> writes:
> 
> > On Sat, Mar 01, 2008 at 12:09:40PM +0100, Peter Bex wrote:
> >> Maybe "Eggs Unlimited" should be a symlink to the latest (ie, Eggs
> >> Unlimited3, currently), and the current Eggs Unlimited page should
> >> be renamed Eggs Unlimited2.  That way call/cc.org does need to be
> >> updated all the time, and the same for any other (wiki) webpage
> >> that points to the eggs unlimited page.
> >> 
> >> (not sure if that's possible with svnwiki?)
> >
> > If it is possbile, someone *PLEASE* fix it.  callcc.org points to
> > the wrong place, the Eggs button on the wiki does too; it's driving
> > me crazy.
> >
> > -Robin
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users

-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] readline blocks threads

2008-03-06 Thread Shawn Rutledge
On Wed, Mar 5, 2008 at 11:50 PM, Shawn Rutledge
<[EMAIL PROTECTED]> wrote:
>  So they're using Unix sockets.  It's already non-blocking, so F_SETFL
>  doesn't change the behavior.

But I guess I'm being stupid... readline (or the terminal? as you say)
is blocking, not dbus.  But it's good to know definitely what dbus is
using.

On Thu, Mar 6, 2008 at 12:53 AM, Elf <[EMAIL PROTECTED]> wrote:
>  the problem isnt nonblocking status.
>  the problem is that all the term settings get munged by readline - how else
>  could it interpret arrows, tabs, do paren bouncing, etc.

You mean the same settings that can be changed via stty?  I don't
understand what effect that has.  The usual kind of blocking that can
be turned on is that when you are sitting at a shell prompt,
keystrokes are not sent one-by-one, but rather it can wait until you
hit the enter key and send the whole command all at once; this is a
feature that can help with slow serial connections or packet networks.
 But I don't think that mode is in use much these days, and readline
would be turning off that feature, right? because it has to see each
keystroke in order to do all the tricks.  Or you think it's on the
output side, that the threads are blocked because output going from
csi to the screen does not pass through until it is flushed?  Then
maybe a thread which does no output would run fine, but one which
displays status messages would block?

>  i am working on a pure scheme readlineish lib to compensate with 
> approximately
>  the same feature set as what is presently there.  it should be done shortly.

OK I'll look forward to it.

So you don't have any philosophical problem with the idea that an egg
which does polling should automatically start a thread to do that?

>  however, instead of coding right now, im going through the almost 500 eggs
>  to make sure that the licence data is correct (ie, the licence tag and the

Doesn't sound like much fun.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] chicken-setup broken

2008-03-06 Thread Jim Ursetto
Hi,

chicken-setup seems to be broken (r9210).

--  Install of egg located in current directory fails:

[EMAIL PROTECTED] ~$ echo $TMPDIR $CHICKEN_TMPDIR

[EMAIL PROTECTED] ~$ ll objc.egg
-rw-r--r--   1 root  jim  64708 Jan 14 01:00 objc.egg
[EMAIL PROTECTED] ~$ sudo chicken-setup objc
Error: (open-input-file) can not open file - No such file or
directory: "/tmp/chicken-setup-3-root/downloads/objc.egg"

--  Install of downloaded egg fails:

[EMAIL PROTECTED] ~$ sudo chicken-setup hostinfo
The extension hostinfo does not exist.
Do you want to download it ? (yes/no/abort) [yes] yes
downloading hostinfo.egg from (www.call-with-current-continuation.org
eggs/3 80)
Error: (open-input-file) can not open file - No such file or directory:
"/tmp/chicken-setup-3-root/downloads/tmp/chicken-setup-3-root/downloads/hostinfo...


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Revised Chapter 1 (reminder)

2008-03-06 Thread John Cowan
Ashley Bone scripsit:

> The mingw and mingw-msys builds are pretty much the same.  Both give
> you a chicken built against the mingw headers and import libraries.
> The only difference is the environment where you actually run make.
> Makefile.mingw is can be used in cmd.exe with the version of make
> that comes with mingw.  Makefile.mingw-msys requires the msys shell
> since it uses unix command (cp, rm, etc).  The end product is the
> same.

So in that case what use is the mingw-msys build?

I had thought that the result of the mingw-msys build was code parts of
which (chicken-setup, chicken-bug, or whatever) could only be used if
msys was present at run time.  If that's not the case, it seems pointless
to maintain both builds, since anyone with or without msys can use the
mingw build.

-- 
Eric Raymond is the Margaret Mead   John Cowan
of the Open Source movement.[EMAIL PROTECTED]
--Bruce Perens, http://www.ccil.org/~cowan
  some years ago


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Web generation + localization.

2008-03-06 Thread Peter Bex
On Thu, Mar 06, 2008 at 06:09:07PM +0100, Tobia Conforto wrote:
> Peter Bex wrote:
> > Then, you have one translation step that extracts all the (trans ..)  
> > things, resulting in the list ("this is a test", "My first test",  
> > "we have some testing stuff here") which then can be used in one  
> > query that returns the translations.
> 
> How would you look all those strings up in a single query?
> I guess it depends on the database / other storage engine you're going  
> to use, but I'm curious.

How about:

SELECT match.str, translations.translation
FROM translations
FULL OUTER JOIN (VALUES (1, 'hello world'), (2, 'chicken rocks'), (3, 'blah'))
AS match(id, str)
ON translations.source = match.str
WHERE translations.lang = 'nl'
ORDER BY match.id;

Returns this:
  str  | translation  
---+--
 hello world   | hallo wereld
 chicken rocks | chicken regeert
 blah  | NULL

There are probably other ways to do this, but this is what I can come up
with quickly.  The match id is necessary to keep the list in the order you
have the initial to-be-translated strings in.  You can also leave off the
'source' column as that's not strictly necessary since we generate the
result set in the same ordering as our original strings.

The VALUES line would be generated and the translations language can be
selected dynamically as well.  This seems to be a PostgreSQL-only feature,
though.  Another solution would be to generate a temporary table or some
view and select the values from that, or just not to order the result set
and compare the strings you get from SQL in Chicken to the
to-be-translated strings.  Of course, if you define a stored procedure in
your DB you can do anything you want too.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
-- Donald Knuth


pgpeTFwgcAV9l.pgp
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Trashing of Egg documentation changes?

2008-03-06 Thread Robin Lee Powell

On Eggs Unlimited 3, the top of the "Web programming" section looks
like this (rendered, not source):

Web programing



ajax Using xmlHttpRequest with the Spiffy web-server MIT [[felix winkelmann]] 
Dependencies

I've fixed both these problems (the web-unity failure and the
[[...]] around felix's name) twice now, but they keep being
regenerated.

Is this page auto-generated?  If so, could the page *explain* this
at the top, so I can change the right stuff?

Also, I've made some minor clarifying changes to the spiffy docs at
http://chicken.wiki.br/spiffy ; is that going to be trashed too?

-Robin

-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Web generation + localization.

2008-03-06 Thread Tobia Conforto

Peter Bex wrote:
Then, you have one translation step that extracts all the (trans ..)  
things, resulting in the list ("this is a test", "My first test",  
"we have some testing stuff here") which then can be used in one  
query that returns the translations.


How would you look all those strings up in a single query?
I guess it depends on the database / other storage engine you're going  
to use, but I'm curious.



Tobia


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Revised Chapter 1 (reminder)

2008-03-06 Thread Ashley Bone

John Cowan wrote:

Vincent Manis scripsit:


  1. Someone added TODOs suggesting a discussion of MinGW and MinGW/
MSys builds; I would ask whoever did that to add a small amount of
content, or perhaps a pointer to somewhere else, on those topics.


I asked because I myself want to know the answer!

When I used Windows (I don't run it any more), I always used Cygwin
builds, so the difference between mingw and msys builds is a mystery
to me.  Can someone enlighten us either on the wiki or here on the list
(in which case I will transport it to the wiki?)


The mingw and mingw-msys builds are pretty much the same.  Both give
you a chicken built against the mingw headers and import libraries.
The only difference is the environment where you actually run make.
Makefile.mingw is can be used in cmd.exe with the version of make
that comes with mingw.  Makefile.mingw-msys requires the msys shell
since it uses unix command (cp, rm, etc).  The end product is the
same.

I'd suggest combining the paragrapsh on the MinGW/msys builds and just 
noting that makefiles exist for cmd.exe and msys.


ashley


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Revised Chapter 1 (reminder)

2008-03-06 Thread Vincent Manis

On 2008 Mar 06, at 01:01, felix winkelmann wrote:

On Wed, Mar 5, 2008 at 10:09 PM, Vincent Manis <[EMAIL PROTECTED]>  
wrote:
A couple of weeks ago, I posted a draft of a new version of Chapter  
1 of
the manual, and asked for comments. There have been a few things  
added,
and I think that the new version is almost ready. There are still  
some

links to add, and a couple of more substantive things.


Absolutely great! Should this chapter just replace the current  
"Overview"

page, then?


I think it can...I kept all the content from the current page.

-- v


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] INI files in Scheme? (or something similar)

2008-03-06 Thread Kon Lovett


On Mar 3, 2008, at 5:58 PM, Mario Domenech Goulart wrote:


Hi Hans,

On Mon, 03 Mar 2008 20:22:11 -0500 Hans Nowak  
<[EMAIL PROTECTED]> wrote:



Is there a "standard" way to do INI files (or similar kinds of
initialization files, ala .bashrc etc) in Scheme?  For example,
something like this:






Of course, there are many other ways.


SRFI-29



Best wishes,
Mario


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Best Wishes,
Kon




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: regex and named subpatterns

2008-03-06 Thread felix winkelmann
On Thu, Mar 6, 2008 at 3:40 PM, John Cowan <[EMAIL PROTECTED]> wrote:
> Alex Shinn scripsit:
>
>
>  > Chicken regexp's historically weren't tied to PCRE, and
>  > provided a fairly minimal feature set to accomodate all the
>  > backends equally.  It now always uses PCRE, and you could
>  > get at the named subpatterns with pcre_get_named_substring()
>  > if you returned the match object, but personally I don't
>  > think it should be bound too strongly to PCRE.
>
>  I think the contrary: since we are committed to allowing access to the
>  extended regex features of PCRE (which helps portability: no more random
>  lossage because I use an extension that your regex package doesn't have),
>  we should also provide access to the API of PCRE.  This seems to me much
>  more Chicken-y.

Hm, I think not: committing to PCRE ensures all use the same regexp
flavor, not more. If we need more API at all, it should go into:

http://chicken.wiki.br/regex-extras


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: regex and named subpatterns

2008-03-06 Thread John Cowan
Alex Shinn scripsit:

> Chicken regexp's historically weren't tied to PCRE, and
> provided a fairly minimal feature set to accomodate all the
> backends equally.  It now always uses PCRE, and you could
> get at the named subpatterns with pcre_get_named_substring()
> if you returned the match object, but personally I don't
> think it should be bound too strongly to PCRE.

I think the contrary: since we are committed to allowing access to the
extended regex features of PCRE (which helps portability: no more random
lossage because I use an extension that your regex package doesn't have),
we should also provide access to the API of PCRE.  This seems to me much
more Chicken-y.

-- 
Andrew Watt on Microsoft:   John Cowan
Never in the field of human computing   [EMAIL PROTECTED]
has so much been paid by so manyhttp://www.ccil.org/~cowan
to so few! (pace Winston Churchill)


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] web-scheme & hart

2008-03-06 Thread Graham Fawcett
On 05 Mar 2008 23:29:19 -0300, Mario Domenech Goulart
<[EMAIL PROTECTED]> wrote:
>  On Wed, 5 Mar 2008 17:45:42 -0800 Robin Lee Powell <[EMAIL PROTECTED]> wrote:
>
>  > It seems to me that web-scheme and hart do more-or-less the same
>  > thing.
>  > 2.  What's the difference between web-scheme and hart?  Do people
>  > have preferences between the two?
>
>  I don't know much about hart.  I think Graham can write about it.

Briefly, Hart is a syntax extension that tries to turn as much of your
"html expression" into simple print statements at macro-expansion
time. The base-case, where nothing in your expression requires
variable-substitution, turns into a single print statement:

#;2> ,x (hart (h1 (@ (id "main")) "hello"))
(noop (begin (hart-print "hello")))

Adding variables makes it a bit more verbose at expansion time.

#;2> ,x (hart (h1 (@ (id my-h1-id)) (t: my-h1-text)))
(noop (begin
(hart-print "")
(apply hart-print (map hart-html-escape (list my-h1-text)))
(hart-print "")))

My goal was to develop a nice syntax, but also to reduce runtime
overhead as much as possible. I've never properly benchmarked it
against other options (I haven't used Mario's egg; I used to use the
shtml->html option in the htmlprag egg). Also, I haven't really tried
to optimize it, beyond compiling with an -On flag, and using a
fast-if-primitive html-escape routine. I guess I found that it was
efficient enough for my needs.

One thing I'd like to add is better support for HTML entities,
probably following SXML syntax:

(hart (p "Come back to the five " (& "amp") " dime, Jimmy Dean..."))

right now you need to use a (raw: ...) or (scheme: ...) block to do that:

(hart (p (raw: "Come back to the five & dime, Jimmy Dean...")))
(hart (p "Come back to the five " (raw: "&") " dime, Jimmy Dean..."))
(hart (p "Come back to the five " (scheme: (print "&")) " dime,
Jimmy Dean..."))

Hope this helps. Comments and suggestions are always welcome.

Graham


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] google summer of code

2008-03-06 Thread Alaric Snell-Pym


On 6 Mar 2008, at 2:08 am, Ivan Raikov wrote:



  Well, I think modifying or rewriting the garbage collector would be
quite a lot of work for one summer, for someone who is presumably not
familiar with the Chicken internals. The rest I agree with. MPI is one
such multi-process model, and although it is often criticized for its
communication overhead, I would really like to see some examples
outside of scientific computing where this overhead really matters.


I wrote an efficient shared-memory lock-free queue system for a
client once. They own the copyright, but I would happily mentor a
student to build a somewhat more general and portable (this was
specific to a few platforms) version of it in C and wrap it in
chicken for lightweight interprocess goodness :-)

I'm also keen on a proper library/module system, though. I'd like to
be able to use multiple macro systems in the same source file, for a
start. So something where chicken itself has a notion of a macro
environment, and macro systems just register closures in an alist or
whatever that (define-syntax ...) dispatches on to convert whatever
the user supplies into a closure that rewrites syntax objects, then
when the macro is invoked, that closure can be applied to perform the
rewrite. Then the module system needs to know that there are two
environments - values and syntax - to expose from modules and import
into places, and all should be well. Surely?

In fact, I'm so keen on a module system that knows about macros and
lets me use multiple macro systems seamlessly, I was considering that
as soon as I have some money spare (soon... soon... please God let me
be out of debt soon...) I'd offer a bounty for whoever did it, as my
near future points to more of an excess of money than time!



   -Ivan




ABS

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/?author=4




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: regex and named subpatterns

2008-03-06 Thread Alex Shinn
> "Hans" == Hans Nowak <[EMAIL PROTECTED]> writes:

Hans> In PCRE, a subpattern can be named in one
Hans> of three ways: (?...)  or (?'name'...)  as
Hans> in Perl, or (?P...) as in Python.

Yep, PCRE is "Perl Compatible" - it's an entirely separate
code-base from the Perl regexp engine.

Hans> It's a bit odd though that Chicken (maybe
Hans> unintentionally) supports the construct in regular
Hans> expressions, but provides no ways to make use of
Hans> it.

Chicken regexp's historically weren't tied to PCRE, and
provided a fairly minimal feature set to accomodate all the
backends equally.  It now always uses PCRE, and you could
get at the named subpatterns with pcre_get_named_substring()
if you returned the match object, but personally I don't
think it should be bound too strongly to PCRE.

Note that you don't need the match object to implement the
style you're used to, the positions list gives you all the
info you need:

  (define (rxmatch-group str m n)
(let ((pos (list-ref m n)))
  (cons (substring str (car pos) (cadr pos)) pos)))

  (define (rxmatch-group-string str m n)
(let ((pos (list-ref m n)))
  (substring str (car pos) (cadr pos

... will give you exactly the same behavior you demonstrated
(except that you need to pass the string).

Named matches *would* need the original object, though, or
alternately some extension including an alist with the
positions list.

-- 
Alex


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Web generation + localization.

2008-03-06 Thread Elf

On Thu, 6 Mar 2008, Peter Bex wrote:


On Wed, Mar 05, 2008 at 06:17:05PM -0800, Robin Lee Powell wrote:


So I gots me a web app to write.

I also want to be prepped for other (spoken) languages, for similar
reasons, and because I'm nerdy that way. There are libraries that
will allow insertion of arbitrary Scheme into otherwise normal HTML
files (i.e. spiffy's ssp stuff). There are other libraries that
allow writing a web page as Scheme (i.e. hart).

Does any one have any other suggestions, or preferences amongst
those options, or anything?


I've spent a bit of time thinking about this (unfortunately, no time
to code it up yet).  At work we use Drupal, which simply requires
you to wrap translatable strings with a function call to t(...).
This is a solution that absolutely does not scale well because everytime
it sees a t() call, it hits the database to retrieve the string.
It caches pages, but still we see a lot of overhead in the roundtrips
to the database for uncached pages.

So I've been thinking, if you use sxslt translations (or similar
s-expression based templates), you can first extract all translatable
strings by folding over the template _just_ before you rewrite the
s-expressions to HTML/XML strings, then you do one big query to request
them all at once, and then you insert the strings as needed.

Example:

`(html
  (head (title (trans "this is a test")))
  (body
(h1 (trans "My first test"))
(p (trans "we have some testing stuff here"

Then, you have one translation step that extracts all the (trans ..)
things, resulting in the list ("this is a test", "My first test",
"we have some testing stuff here") which then can be used in one query
that returns the translations.
After that, you go through the sxml again and replace all (trans "..")
by their translation.

Sorry for the hand-waving - I wouldn't have put this out without code to
back it, but it would be a shame if you would go about it the Drupal way
and then would have to reimplement something.



you can go one further ... apply the list to the proc instead, and you wont
even have repeated list lookups, youll have the final string.

-elf
#\space ... the final string



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Web generation + localization.

2008-03-06 Thread Peter Bex
On Wed, Mar 05, 2008 at 06:17:05PM -0800, Robin Lee Powell wrote:
> 
> So I gots me a web app to write.
> 
> I also want to be prepped for other (spoken) languages, for similar
> reasons, and because I'm nerdy that way. There are libraries that
> will allow insertion of arbitrary Scheme into otherwise normal HTML
> files (i.e. spiffy's ssp stuff). There are other libraries that
> allow writing a web page as Scheme (i.e. hart).
> 
> Does any one have any other suggestions, or preferences amongst
> those options, or anything?

I've spent a bit of time thinking about this (unfortunately, no time
to code it up yet).  At work we use Drupal, which simply requires
you to wrap translatable strings with a function call to t(...).
This is a solution that absolutely does not scale well because everytime
it sees a t() call, it hits the database to retrieve the string.
It caches pages, but still we see a lot of overhead in the roundtrips
to the database for uncached pages.

So I've been thinking, if you use sxslt translations (or similar
s-expression based templates), you can first extract all translatable
strings by folding over the template _just_ before you rewrite the
s-expressions to HTML/XML strings, then you do one big query to request
them all at once, and then you insert the strings as needed.

Example:

`(html
   (head (title (trans "this is a test")))
   (body
 (h1 (trans "My first test"))
 (p (trans "we have some testing stuff here"

Then, you have one translation step that extracts all the (trans ..)
things, resulting in the list ("this is a test", "My first test",
"we have some testing stuff here") which then can be used in one query
that returns the translations.
After that, you go through the sxml again and replace all (trans "..")
by their translation.

Sorry for the hand-waving - I wouldn't have put this out without code to
back it, but it would be a shame if you would go about it the Drupal way
and then would have to reimplement something.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
-- Donald Knuth


pgpyG958vbiTf.pgp
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Revised Chapter 1 (reminder)

2008-03-06 Thread felix winkelmann
On Wed, Mar 5, 2008 at 10:09 PM, Vincent Manis <[EMAIL PROTECTED]> wrote:
> A couple of weeks ago, I posted a draft of a new version of Chapter 1 of
>  the manual, and asked for comments. There have been a few things added,
>  and I think that the new version is almost ready. There are still some
>  links to add, and a couple of more substantive things.

Absolutely great! Should this chapter just replace the current "Overview"
page, then?


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] srfi-29 egg problems: [EMAIL PROTECTED] doesn't seem to work?

2008-03-06 Thread felix winkelmann
On Wed, Mar 5, 2008 at 8:28 AM, Robin Lee Powell
<[EMAIL PROTECTED]> wrote:
>
>  I copied the attached example directly from
>  http://srfi.schemers.org/srfi-29/srfi-29.html , with the following
>  changes:
>
>  1.  I don't use store-bundle! or load-bundle! at all
>
>  2.  I force the language to French.
>
>  Actually running it gives me:
>
>  Error: (fprintf) illegal format-string character: #\1
>
> Call history:
>
> (localized-message (quote goodbye) myname)
> (quote goodbye)
> (display #\newline)
>   (display (localized-message (quote time) "12:00" 
> myname))
>   (localized-message (quote time) "12:00" myname)
>   [localized-message] (apply format (cons 
> (localized-template (quote hello-program) message-name) args))
>   [localized-message] (cons (localized-template (quote 
> hello-program) message-name) args)
>   [localized-message] (localized-template (quote 
> hello-program) message-name) <--
>
>  This seems te be coming from the "[EMAIL PROTECTED], c'est ~a." string, which
>  srfi-29 says it supports.  Am I missing something?
>
>  CHICKEN Version 2.726
>
>  Just downloaded the egg, so should be the latest.
>

You need a version of "format" that is more capable than the builtin
one (which builds on [sf]printf). Install "format-modular" or "format", and
load that before srfi-29.


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] readline blocks threads

2008-03-06 Thread Elf


the problem isnt nonblocking status.
the problem is that all the term settings get munged by readline - how else
could it interpret arrows, tabs, do paren bouncing, etc.
i am working on a pure scheme readlineish lib to compensate with approximately
the same feature set as what is presently there.  it should be done shortly.

however, instead of coding right now, im going through the almost 500 eggs
to make sure that the licence data is correct (ie, the licence tag and the
actual licence match and have the right names, and the docs match the
licences, and that all versioned licences have the proper version appended
to them (eg LGPL-2.1)) because the daily licence muddle has got to stop.

-elf

On Wed, 5 Mar 2008, Shawn Rutledge wrote:


On Tue, Mar 4, 2008 at 4:22 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote:

 Just curious, does the nbstdin egg help at all? I know it helps when
 I'm running a REPL inside a Web app.


Thanks for the suggestion.  The relevant part of that seems to be this:

 int val = fcntl(fd, F_GETFL, 0);
 if(val == -1) return(0);
 return(fcntl(fd, F_SETFL, val | O_NONBLOCK) != -1);

so I tried doing that myself:

int ufd, sfd;
dbus_connection_get_unix_fd(conn, &ufd);
dbus_connection_get_socket(conn, &sfd);
printf(\"unix FD %d, socket %d\\n\", ufd, sfd);
int val = fcntl(sfd, F_GETFL, 0);
printf(\"existing flags: 0x%X\\n\", val);
if(val != -1)
printf(\"fctntl returns %d\\n\",
  fcntl(sfd, F_SETFL, val | O_NONBLOCK));

out of which I see

unix FD 4, socket 4
existing flags: 0x802
fctntl returns 0

so according to the existing flags gotten from F_GETFL, it's already a
non-blocking fd.  lsof gives me this

csi   15457 rutledge4u  unix 0xd935e860292124 socket

So they're using Unix sockets.  It's already non-blocking, so F_SETFL
doesn't change the behavior.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users