calling scheme procedures by name from C

2009-08-02 Thread Richard Shann
Hi, I want to call a scheme procedure with four arguments from C. (The example scheme procedure here is just displaying its arguments.) (define (d-UploadRoutine a b c d) (display a) (display b) (display c) (display d)) But I can't find what the correct parameters types are - the headers j

How to flush history ?

2009-08-02 Thread Roberto Rosetti
Hi all, I'm wondering how to flush the recent readline history to a file. I need this feature for an educational project. The purpose is to permit the REPL user to save his entire history with a simple command. Something like (flush-history ) I've read something about (loggin logger) module but th

Re: calling scheme procedures by name from C

2009-08-02 Thread Linas Vepstas
2009/8/2 Richard Shann : > Hi, > I want to call a scheme procedure with four arguments from C. > (The example scheme procedure here is just displaying its arguments.) > > (define (d-UploadRoutine a b c d) >  (display a) >  (display b) >  (display c) >  (display d)) > > But I can't find what the cor

Re: calling scheme procedures by name from C

2009-08-02 Thread Richard Shann
On Sun, 2009-08-02 at 06:17 -0500, Linas Vepstas wrote: > 2009/8/2 Richard Shann : > > Hi, > > I want to call a scheme procedure with four arguments from C. > > (The example scheme procedure here is just displaying its arguments.) > > > > (define (d-UploadRoutine a b c d) > > (display a) > > (dis

Re: calling scheme procedures by name from C

2009-08-02 Thread Paul Emsley
Richard Shann wrote: SCM proc = gh_str2scm("d-UploadRoutine", strlen("d-UploadRoutine")); // proc = scm_string_to_symbol("d-UploadRoutine"); // proc = scm_string_to_symbol( gh_str2scm("d-UploadRoutine", strlen("d-UploadRoutine"))); SCM arg1 = gh_str2scm("hello", strlen("hello")); SCM arg2 =

Re: calling scheme procedures by name from C

2009-08-02 Thread Richard Shann
On Sun, 2009-08-02 at 14:00 +0100, Paul Emsley wrote: > Richard Shann wrote: > > > > SCM proc = gh_str2scm("d-UploadRoutine", strlen("d-UploadRoutine")); > > // proc = scm_string_to_symbol("d-UploadRoutine"); > > // proc = scm_string_to_symbol( gh_str2scm("d-UploadRoutine", > > strlen("d-Uploa

Re: calling scheme procedures by name from C

2009-08-02 Thread Mike Gran
On Sun, 2009-08-02 at 06:17 -0500, Linas Vepstas wrote: > 2009/8/2 Richard Shann : > The gh_* routines are old and deprecated, and have been for about > a decade now .. don't use them. > > On the other hand, I notice that the tutorial at > http://www.gnu.org/software/guile/docs/docs.html > still u

Re: calling scheme procedures by name from C

2009-08-02 Thread Linas Vepstas
2009/8/2 Mike Gran : > > Oh my oh my.  I wrote that doc at lonelycactus.com quite awhile ago.  I > keep meaning to take it down, because the way I did things was a little > strange and a little old.  But, oddly, there are few other > tutorial-level resources.  Someone really ought to put something

Re: calling scheme procedures by name from C

2009-08-02 Thread Linas Vepstas
2009/8/2 Daniel Kraft : > Linas Vepstas wrote: >> >> 2009/8/2 Mike Gran : >>> >>> Oh my oh my.  I wrote that doc at lonelycactus.com quite awhile ago.  I >>> keep meaning to take it down, because the way I did things was a little >>> strange and a little old.  But, oddly, there are few other >>> tu

Re: calling scheme procedures by name from C

2009-08-02 Thread Peter TB Brett
On Sun, 02 Aug 2009 14:00:48 +0100, Paul Emsley wrote: > and p.s. use the new style interface not the gh_* one. e.g. SCM arg1 = > scm_makfrom0str("hello"); I believe scm_makfrom0str is deprecated, and that new code should use scm_from_locale_string. Regards, Pe

Re: calling scheme procedures by name from C

2009-08-02 Thread Linas Vepstas
2009/8/2 Daniel Kraft : >> Yeah, X examples are rather anachronistic.  I dunno, an OpenGL >> version might be fun.  Imagine .. 3D programming in scheme ..! >> it would not be a bad idea, I don't think. > > Hm... Maybe allowing to build a simple 3D scene, like: > > (define x (make-scene)) > (add-sp

Re: calling scheme procedures by name from C

2009-08-02 Thread Daniel Kraft
Linas Vepstas wrote: 2009/8/2 Mike Gran : Oh my oh my. I wrote that doc at lonelycactus.com quite awhile ago. I keep meaning to take it down, because the way I did things was a little strange and a little old. But, oddly, there are few other tutorial-level resources. Someone really ought to

Re: calling scheme procedures by name from C

2009-08-02 Thread Daniel Kraft
Linas Vepstas wrote: -- so does anyone know who wrote it and where/what it is meant to be? I don't get what you are saying ... at the bottom of your URL it says clearly: "I wrote this page because ... etc Copyright (c) 2000 David Drysdale Permission is granted to copy, distribute and/or modif