From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Kjetil S. Matheussen" Newsgroups: gmane.lisp.guile.user Subject: Re: the future of Guile Date: Thu, 6 Dec 2007 15:52:58 +0100 (CET) Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: ger.gmane.org 1196952818 31284 80.91.229.12 (6 Dec 2007 14:53:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2007 14:53:38 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Dec 06 15:53:46 2007 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0I6b-0000bg-6D for guile-user@m.gmane.org; Thu, 06 Dec 2007 15:53:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0I6K-0003uu-7E for guile-user@m.gmane.org; Thu, 06 Dec 2007 09:53:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J0I6F-0003rX-MC for guile-user@gnu.org; Thu, 06 Dec 2007 09:53:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J0I6C-0003pc-1i for guile-user@gnu.org; Thu, 06 Dec 2007 09:53:15 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0I6B-0003pZ-UO for guile-user@gnu.org; Thu, 06 Dec 2007 09:53:11 -0500 Original-Received: from mail-forward.uio.no ([129.240.10.42]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J0I6B-0000eV-HV for guile-user@gnu.org; Thu, 06 Dec 2007 09:53:11 -0500 Original-Received: from mail-mx9.uio.no ([129.240.10.39]) by pat.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1J0I63-0003lB-34 for guile-user@gnu.org; Thu, 06 Dec 2007 15:53:03 +0100 Original-Received: from bjo1-1x-dhcp290.studby.uio.no ([193.157.245.38]) by mail-mx9.uio.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1J0I60-0005re-PW for guile-user@gnu.org; Thu, 06 Dec 2007 15:53:00 +0100 X-X-Sender: kjetil@ttleush In-Reply-To: X-UiO-ClamAV-Virus: No X-UiO-Spam-info: not spam, SpamAssassin (score=0.0, required=5.0, autolearn=disabled, AWL=0.004) X-UiO-Scanned: B92335EE3DC174740E7C6951C777216E513FFAD8 X-UiO-SPAM-Test: remote_host: 193.157.245.38 spam_score: 0 maxlevel 200 minaction 2 bait 0 mail/h: 2 total 561 max/h 6 blacklist 0 greylist 0 ratelimit 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6349 Archived-At: "Marco Maggi": >> 3b. Death to structs! IMO they were "an attempt", but the >> resulting code is awful (sorry, but can you disagree?). >> >> Err.. but aren't structs the main part of how GOOPS is >> implemented? > > IMO Guile's structs do nothing that cannot be done better > with a good old C struct wrapped by a SMOB. I've mentioned this before, but In Snd there is a function to automatically create C structs. You have to free the underlying c object manually though, but adding a SMOB wrapper around shouldn't be that hard. Oh, and thats yet another "should" for HBGC: You don't need to mess with SMOBs to garbage collect C objects when using the HBGC. (load "eval-c.scm") (define-ec-struct one twos three scm) (define test ( :one 1 :twos '(2) :three "three")) (-> test one) => 1 (-> test one 90) (-> test one) => 90 (-> test twos) => (2.0) (-> test twos '(4 5 6)) (-> test twos) => (4.0 5.0 6.0) (-> test three) => "three" (-> test three "four") (-> test three) => "four" (-> test scm) => #f (-> test scm (lambda (x) x)) ;; stored elsewhere too, so it won't be gc-ed. (-> test scm) => # (-> test get-size) => 16 (-> test get-c-object) => ("A_POINTER" 147502592) (-> test destructor) ;;free it _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user