Re: [Chicken-users] Dumbass newbie questions. Sorry.

2009-04-16 Thread Neil Baylis
Excellent, thanks. That works for me.

On Thu, Apr 16, 2009 at 3:58 PM, Shawn Rutledge
wrote:

> 2009/4/16 Neil Baylis :
> > Re processes/pipes, I had found those by looking in the manual, but am
> not
> > yet sharp enough in scheme to understand them. It looks as though
> > (process...) is what I need, but I'm not sure how to use it.
>
> It will give you "ports" for stdin/stdout.  e.g. (example to ssh to a
> server, start a process and interact with it):
>
> (let-values ([(recv-port send-port connppid) (process "ssh
> rutle...@neutron \"cd prj/dscm/services; ./x10-wish\"")])
> ...
> then you can send and receive stuff, e.g.
>
> (display "hey there" send-port)
> and
> (let ([response (read recv-port)])
>  ... figure out what to do with it ...)
>
> This chapter provides a starting overview of I/O in Scheme in general
> (not Chicken-specific):
>
> http://www.scheme.com/tspl3/io.html
>
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Dumbass newbie questions. Sorry.

2009-04-16 Thread Shawn Rutledge
2009/4/16 Neil Baylis :
> Re processes/pipes, I had found those by looking in the manual, but am not
> yet sharp enough in scheme to understand them. It looks as though
> (process...) is what I need, but I'm not sure how to use it.

It will give you "ports" for stdin/stdout.  e.g. (example to ssh to a
server, start a process and interact with it):

(let-values ([(recv-port send-port connppid) (process "ssh
rutle...@neutron \"cd prj/dscm/services; ./x10-wish\"")])
...
then you can send and receive stuff, e.g.

(display "hey there" send-port)
and
(let ([response (read recv-port)])
 ... figure out what to do with it ...)

This chapter provides a starting overview of I/O in Scheme in general
(not Chicken-specific):

http://www.scheme.com/tspl3/io.html


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


Re: [Chicken-users] Dumbass newbie questions. Sorry.

2009-04-16 Thread Neil Baylis
On Thu, Apr 16, 2009 at 3:28 PM, Nicholas "Indy" Ray wrote:

> err http://chicken.wiki.br/man/3/Unit%20posix#pipes for the third link.
>
> Indy
>
> On 4/16/09, Nicholas "Indy" Ray  wrote:
> > On 4/16/09, neil.bay...@gmail.com  wrote:
> >  > First question: For various reasons, I can't switch to chicken 4 any
> time
> >  > soon. But I can't find the eggs for 3.4 etc. Where are they?
> >
> >
> > Chicken-setup will download the chicken eggs, the ref is here:
> >  http://chicken.wiki.br/eggref/3/index
> >
> >
> >  > Second question: What's the canonical scheme (esp. Chicken) way to do
> >  > pexpect like things? I.e., spawn a long lived process, send strings to
> its
> >  > stdin, and deal with what is sends to its stdout? Is there a library?
> An
> >  > example?
> >
> >
> > Not sure, but there are some process funcs in the possix unit:
> >  http://chicken.wiki.br/man/3/Unit%20posix#processes
> >
> >  Additionally on opening a pipe:
> >  http://chicken.wiki.br/man/3/Unit%20posix#processes
> >
> >
> >  Indy
> >
>

Thanks, I see the eggs now.

Re processes/pipes, I had found those by looking in the manual, but am not
yet sharp enough in scheme to understand them. It looks as though
(process...) is what I need, but I'm not sure how to use it.

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


Re: [Chicken-users] Dumbass newbie questions. Sorry.

2009-04-16 Thread Nicholas "Indy" Ray
err http://chicken.wiki.br/man/3/Unit%20posix#pipes for the third link.

Indy

On 4/16/09, Nicholas "Indy" Ray  wrote:
> On 4/16/09, neil.bay...@gmail.com  wrote:
>  > First question: For various reasons, I can't switch to chicken 4 any time
>  > soon. But I can't find the eggs for 3.4 etc. Where are they?
>
>
> Chicken-setup will download the chicken eggs, the ref is here:
>  http://chicken.wiki.br/eggref/3/index
>
>
>  > Second question: What's the canonical scheme (esp. Chicken) way to do
>  > pexpect like things? I.e., spawn a long lived process, send strings to its
>  > stdin, and deal with what is sends to its stdout? Is there a library? An
>  > example?
>
>
> Not sure, but there are some process funcs in the possix unit:
>  http://chicken.wiki.br/man/3/Unit%20posix#processes
>
>  Additionally on opening a pipe:
>  http://chicken.wiki.br/man/3/Unit%20posix#processes
>
>
>  Indy
>


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


Re: [Chicken-users] Dumbass newbie questions. Sorry.

2009-04-16 Thread Nicholas "Indy" Ray
On 4/16/09, neil.bay...@gmail.com  wrote:
> First question: For various reasons, I can't switch to chicken 4 any time
> soon. But I can't find the eggs for 3.4 etc. Where are they?

Chicken-setup will download the chicken eggs, the ref is here:
http://chicken.wiki.br/eggref/3/index

> Second question: What's the canonical scheme (esp. Chicken) way to do
> pexpect like things? I.e., spawn a long lived process, send strings to its
> stdin, and deal with what is sends to its stdout? Is there a library? An
> example?

Not sure, but there are some process funcs in the possix unit:
http://chicken.wiki.br/man/3/Unit%20posix#processes

Additionally on opening a pipe:
http://chicken.wiki.br/man/3/Unit%20posix#processes

Indy


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


[Chicken-users] Dumbass newbie questions. Sorry.

2009-04-16 Thread neil . baylis
First question: For various reasons, I can't switch to chicken 4 any time  
soon. But I can't find the eggs for 3.4 etc. Where are they?


Second question: What's the canonical scheme (esp. Chicken) way to do  
pexpect like things? Ie, spawn a long lived process, send strings to its  
stdin, and deal with what is sends to its stdout? Is there a library? An  
example?


Thank you,

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


Re: [Chicken-users] egg path?

2009-04-16 Thread Shawn Rutledge
On Thu, Apr 16, 2009 at 11:09 AM, Shawn Rutledge
 wrote:
> #;1> (use dbus)
>
> Error: (import) during expansion of (import ...) - cannot import from
> undefined module: dbus

It didn't say "; loading ./dbus.so ..." though, which is why I don't
think it did.

#;1> (use dbus)
...
#;1> dbus:send
Error: unbound variable: dbus:send
#;1> (require-library dbus)
; loading ./dbus.so ...
Error: unbound variable: dbus:vtable
#;1> dbus:send
#


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


Re: [Chicken-users] egg path?

2009-04-16 Thread Shawn Rutledge
On Thu, Apr 16, 2009 at 2:15 AM, felix winkelmann  wrote:
> On Thu, Apr 16, 2009 at 9:40 AM, Shawn Rutledge
>  wrote:
>> With Chicken 3, (use egg) can load a compiled egg.so in the cwd.  This
>> is especially handy during egg development - you can compile and test
>> repeatedly without having to install.  Chicken 4 doesn't seem to do
>> that.  Is there some concept of an egg path, where it will look for
>> the library?
>
> `use' also does an `import', so you probably should use `require-library'
> or `require', unless your compiled file also contains a module definition.
> Loading from the cwd should still work. See also `repository-path' in the
> manual.

You're right, it's the import in that case.  As part of the egg
porting I should switch to the module system anyway, I guess, since
this egg has a dbus: prefix on everything.  Currently it has (declare
(export ...))  And then (use dbus) will work, right?

#;1> (use dbus)

Error: (import) during expansion of (import ...) - cannot import from
undefined module: dbus

Call history:

(use dbus)
(##core#require-extension (dbus) #t)
(begin (begin (##sys#require (quote
dbus)) (import dbus)) (##core#undefined))
(begin (##sys#require (quote dbus))
(import dbus))
(##sys#require (quote dbus))
(quote dbus)
(import dbus)   <--

#;1> (require "dbus")
; loading ./dbus.so ...

Error: unbound variable: dbus:vtable

Call history:

  (require "dbus")
##sys#peek-c-string
dbus.scm: 78   max
dbus.scm: 164  make-vector
dbus.scm: 165  make-vector
dbus.scm: 166  make-vector
dbus.scm: 175  gensym
dbus.scm: 573  dbus:vtable  <--

#;1> (require-library "dbus")

Error: invalid extension specifier: "dbus"

Call history:

(require-library "dbus")
(##core#require-extension ("dbus") #f)  <--
#;1> (require-library dbus)
; loading ./dbus.so ...
Segmentation fault

(the segfault doesn't occur if I try it from a fresh csi instance though)

dbus:vtable is like this:

(define-foreign-record (dbus:vtable "struct DBusObjectPathVTable")
(constructor: dbus:make-vtable-impl)
(destructor: dbus:free-vtable)
(c-pointer unregister_function)
(c-pointer message_function)
(c-pointer dbus_internal_pad1)
(c-pointer dbus_internal_pad2)
(c-pointer dbus_internal_pad3)
(c-pointer dbus_internal_pad4))

BTW apparently I still have to ask for my egg dirs to be created in
svn under release/4?  If so, please create the ones for dbus and gps.


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


Re: [Chicken-users] egg path?

2009-04-16 Thread Jim Ursetto
On Thu, Apr 16, 2009 at 2:40 AM, Shawn Rutledge
 wrote:
> With Chicken 3, (use egg) can load a compiled egg.so in the cwd.  This
> is especially handy during egg development - you can compile and test
> repeatedly without having to install.  Chicken 4 doesn't seem to do
> that.  Is there some concept of an egg path, where it will look for
> the library?

Hi Shawn,

What's the error you're getting?  It works for me, with 2 caveats:

1) In both Chicken 3 and 4, an installed extension takes precedence
over an .so in the current directory.

2) In Chicken 4, (use xxx) will perform an import, which will fail if
you didn't generate an import library or if your egg is not a module
at all.

If your .so isn't a module, use (require-library xxx) instead.  This
can be a bit annoying from the command line as csi does not have a
"require-library" equivalent to -R.  Instead I have been doing `csi -e
'(require-library xxx)' ...` during testing.

Note: the manual says that USE or REQUIRE-EXTENSION is "equivalent to
(require-library ID ...) but performs an implicit import, if
necessary".  In my experience, it always performs an import; there is
no 'if necessary' about it.  I don't know which is the intended
behavior.

Jim


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


Re: [Chicken-users] chicken-install: prefix problem

2009-04-16 Thread felix winkelmann
On Tue, Apr 14, 2009 at 10:28 PM, fulvio ciriaco  wrote:
> I installed from svn trunk and chicken-install works fine now.
> It took some time to understand how to teach the build system where
> system libraries are kept.
> Perhaps README or Makefile.$(PLATFORM)  should document
> C_COMPILER_OPTIONS
> LINKER_OPTIONS
>
> Here, NetBSD, one needs
> C_COMPILER_OPTIONS += -I/usr/pkg/lib
> LINKER_OPTIONS += -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
>

I've added a note. Thanks for pointing this out.


cheers,
felix


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


Re: [Chicken-users] Keyword parameters bug?

2009-04-16 Thread felix winkelmann
Should be fixed in svn rev. 14268. Thanks for
reporting this.


cheers,
felix


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


[Chicken-users] egg path?

2009-04-16 Thread Shawn Rutledge
With Chicken 3, (use egg) can load a compiled egg.so in the cwd.  This
is especially handy during egg development - you can compile and test
repeatedly without having to install.  Chicken 4 doesn't seem to do
that.  Is there some concept of an egg path, where it will look for
the library?


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