From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mario Storti Newsgroups: gmane.lisp.guile.user Subject: Re: extending FEM enginering package with Guile Date: Tue, 06 Jan 2004 16:35:55 -0300 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <200401061935.i06JZtU3003103@minerva.ceride.gov.ar> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1073417774 31121 80.91.224.253 (6 Jan 2004 19:36:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2004 19:36:14 +0000 (UTC) Cc: mstorti@minerva.ceride.gov.ar Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jan 06 20:36:10 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Adwzo-0006Bo-00 for ; Tue, 06 Jan 2004 20:36:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Adxwn-0004s5-RU for guile-user@m.gmane.org; Tue, 06 Jan 2004 15:37:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Adxw3-0004rZ-Em for guile-user@gnu.org; Tue, 06 Jan 2004 15:36:19 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AdxvU-00041q-Lf for guile-user@gnu.org; Tue, 06 Jan 2004 15:36:16 -0500 Original-Received: from [200.9.237.10] (helo=minerva.ceride.gov.ar) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AdxvT-0003qv-Ba for guile-user@gnu.org; Tue, 06 Jan 2004 15:35:44 -0500 Original-Received: from minerva.ceride.gov.ar (localhost [127.0.0.1]) by minerva.ceride.gov.ar (8.12.5/8.12.5) with ESMTP id i06JZuAs003107; Tue, 6 Jan 2004 16:35:56 -0300 Original-Received: from minerva.ceride.gov.ar (mstorti@localhost) by minerva.ceride.gov.ar (8.12.5/8.12.5/Submit) with ESMTP id i06JZtU3003103; Tue, 6 Jan 2004 16:35:55 -0300 Original-To: guile-user@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2544 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2544 >>>>> On Mon, 05 Jan 2004 16:20:17 -0300, >>>>> Mario Storti said: > I'm discovering Guile, and I found it very exciting. I'm writing a GPL > C++ Finite Element code (see http://venus.ceride.gov.ar/petscfem > ... Thanks to all answering my posting. >>>>> On Mon, 05 Jan 2004 15:26:09 -0500, >>>>> prj@po.cwru.edu (Paul Jarc) said: > Mario Storti wrote: >> the lack of `break' and `continue' in Scheme. > Guile has break and continue (undocumented in the 1.6.4 manual ), but > they are only defined inside the body of the while loop, not at the > top level. (Well, there is a break procedure from srfi-1, but that > does something different.) OK. That seems to be what I expected. I couldn't get `continue' and `break' working in 1.6.4 and I couldn't compile 1.7.0 (errors in configure about the GMP library). Then I have taken the `while' definition from `boot-9.scm' in 1.7.0 and inserted it directly in my code (with a minor modification, since `make-symbol' is not available in 1.6.4.). So I have now a working `while-continue-break' macro. This is a warkaround until a new stable release comes out. >>>>> On Mon, 5 Jan 2004 23:04:14 +0100, >>>>> rm@fabula.de said: > Well, scheme has a rather powerfull syntax facility, you can (and probably > should) write syntactic extensions that match your users needs/expectations. > With the help of macros (esp syntax-case e.a.) you can create your domain > specific "little language". After all, this is one of the reasons why > the FSF did choose scheme as their future embedable scripting language. >> while (cond0) { >> // body1 0; >> // ... >> if (cond1) break; >> // body 1 >> // ... >> if (cond2) continue; >> // body 2 >> // ... >> } >> >> are hard to write, due to the lack of `break' and `continue' in >> Scheme. I think that one can do that with catch/throw bu it also seems >> an overkill. I found some flame wars between some other Lisp dialects >> and Scheme and I anticipate that I'm not interested in starting such a >> discussion. So: Yes, I see that very powerful macros can be written. > Well, scheme has a rather powerfull syntax facility, you can (and probably > should) write syntactic extensions that match your users needs/expectations. > With the help of macros (esp syntax-case e.a.) you can create your domain > specific "little language". After all, this is one of the reasons why > the FSF did choose scheme as their future embedable scripting language. > Flame wars aside, if there is a need for such a syntax it can be implemented. > Heinrich Taube (of Common Lisp Music fame) wrote a guile version of Common > Lisp's loop macro -- i think i once hacked up a guile module wrapper for it. > With that code you can do things like: > (use-modules (clm iter)) > (define (all-squares-upto number) > (loop for n in (iota number) > collect (* n n))) > (loop for language in '(perl python java cobol) > do (format #f "~A sucks!" language)) > ;; break out of a loop > (loop while (= (remainder (current-time ) 2) 0) > do (format #t "Not yet ~%")) > etc. etc. > If you want i can try to find my wrapper and put it online. > Ralf Mattes Thanks. I think that with the `while-continue-break' to be included in next releases is enough. Mario ------------------------- Mario Alberto Storti CIMEC (INTEC/CONICET-UNL), Guemes 3450 - 3000 Santa Fe, Argentina Tel/Fax: +54-342-4511594 e-mail: mstorti@intec.unl.edu.ar http://www.cimec.org.ar/mstorti, http://www.cimec.org.ar ------------------------- _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user