From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: Doc organization (Re: Around again, and docs lead role) Date: Thu, 15 May 2003 11:02:05 -0500 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87n0horyf6.fsf@raven.i.defaultvalue.org> References: <3E92E1B4002B0632@pop3.tiscalinet.es> <3EAFE4EC000D9733@pop1.tiscalinet.es> <87d6its93b.fsf@raven.i.defaultvalue.org> <87isskq2mi.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1053016198 21609 80.91.224.249 (15 May 2003 16:29:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 15 May 2003 16:29:58 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu May 15 18:29:56 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19GLXn-0005Bx-00 for ; Thu, 15 May 2003 18:25:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GLYH-0005GF-05 for guile-devel@m.gmane.org; Thu, 15 May 2003 12:25:53 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19GLUY-0002GK-00 for guile-devel@gnu.org; Thu, 15 May 2003 12:22:02 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19GLEP-0003S4-00 for guile-devel@gnu.org; Thu, 15 May 2003 12:05:22 -0400 Original-Received: from dsl093-098-016.wdc1.dsl.speakeasy.net ([66.93.98.16] helo=defaultvalue.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GLBI-0003Aa-00; Thu, 15 May 2003 12:02:08 -0400 Original-Received: from raven.i.defaultvalue.org (raven.i.defaultvalue.org [192.168.1.7]) by defaultvalue.org (Postfix) with ESMTP id 6D6361F40; Thu, 15 May 2003 11:02:05 -0500 (CDT) Original-Received: by raven.i.defaultvalue.org (Postfix, from userid 1000) id 27CEC215002; Thu, 15 May 2003 11:02:05 -0500 (CDT) Original-To: Neil Jerram User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux) Original-cc: guile-user@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2359 gmane.lisp.guile.user:1957 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2359 Neil Jerram writes: > Rob> hack something like that up if they needed to with a makefile > Rob> and appropriate use of "cat"... > > #include would be very nice, but we'll probably need > something more dynamic as well. I don't see what you mean by cat > though. I hadn't thought very hard about it, but I meant that instead of #include in file foo.c (which would still require some non-scheme code in foo.scm) you could do something primitive like this: foo-real.c: foo-pre.c foo.scm foo-post.c cat foo-pre.c > foo-real.c.tmp echo 'startup_eval_code = "' >> foo-real.c.tmp cat foo.scm >> foo-real.c.tmp echo '";' >> foo-real.c.tmp cat foo-post.c >> foo-real.c.tmp mv foo-real.c.tmp foo-real.c very ugly, of course (really too ugly), but something that could be done right now. I suppose you could also use perl, sed, etc. with similar effect. > Rob> Actually, I've been playing around with code that would > Rob> make something like this possible (as a dumb example): > > Rob> (define (double x) > Rob> (c-syntax > Rob> (if ("SCM_INUMP" x) > Rob> (return (* x x)) > Rob> (return ("scm_apply" ("scm_lookup" "+") x x))))) > > I don't see how this helps - please explain. Well in one possible approach you'd be able to write a file that contained both scheme and this "inline C" code. That file would then be compiled to object code via C. In that arrangement, you wouldn't need a separate file or a giant unwieldy C string for any large embedded Scheme fragments. i.e. as a psuedo-example: (define (show-c-+ x y) (simple-format #t "In C (+ ~A ~A) would yield ~A\n" x y (c-style-int-+ x y))) (define (c-style-int-+ x y) (c-syntax (auto int c_x ("scm_num2int" 1 x %function-name)) (auto int c_y ("scm_num2int" 1 y %function-name)) (return ("scm_int2num" (+ c_x c_y))))) Of course that's not the primary reason I've been playing around with this, but it's another effect. -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel