From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Lucy Newsgroups: gmane.lisp.guile.devel Subject: expression Date: Wed, 23 Jun 2010 16:09:30 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1277328567 12331 80.91.229.12 (23 Jun 2010 21:29:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Jun 2010 21:29:27 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jun 23 23:29:25 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ORXVZ-0005LX-KD for guile-devel@m.gmane.org; Wed, 23 Jun 2010 23:29:21 +0200 Original-Received: from localhost ([127.0.0.1]:44110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORXDV-0003ft-JU for guile-devel@m.gmane.org; Wed, 23 Jun 2010 17:10:41 -0400 Original-Received: from [140.186.70.92] (port=52317 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORXDC-0002K5-Iz for guile-devel@gnu.org; Wed, 23 Jun 2010 17:10:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORXCh-0005an-Vi for guile-devel@gnu.org; Wed, 23 Jun 2010 17:09:54 -0400 Original-Received: from mail-gw0-f41.google.com ([74.125.83.41]:42918) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORXCh-0005ad-TV for guile-devel@gnu.org; Wed, 23 Jun 2010 17:09:51 -0400 Original-Received: by gwb20 with SMTP id 20so562437gwb.0 for ; Wed, 23 Jun 2010 14:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=LoYXa/twJsZhZmxbnL7oq63AlVapohr7BAvVZU538HM=; b=h+UNZCFCNDjmwMBVBJI40Y5kuqf3N/9iypA/61YOsGPUtp5Fpf55zN7BTreiJojTU0 UTLTegyOrO9svdnz7vAm3E+rhONYTh/LLjPNp2pwilAGgF6gEchlPU5wiW9tGA2CLuo6 Ii2ApFUZQ9+RdMWMjzXWWP/Cl1PfGwivc++jQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=MhZLqgU88vkeRihjCyvQmxEozHeW2bEss6EW491OXfS4RaWxw3fSPb0UofDMLMlt7I 8CwBOKihckx5yLO0K/ljbRSmQS0X80dRiKEf/yHq398tx5vAMrgAw2H9ILqdLIDOZQQD N1UKxvkFM0oOgRz+5Lx6l+9eHxJ32HXu4QRks= Original-Received: by 10.101.202.6 with SMTP id e6mr7039428anq.238.1277327390679; Wed, 23 Jun 2010 14:09:50 -0700 (PDT) Original-Received: by 10.101.68.9 with HTTP; Wed, 23 Jun 2010 14:09:30 -0700 (PDT) X-Google-Sender-Auth: 53d9y2-KBVPt-uKwGpg18FWEunw X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10554 Archived-At: Hey, Is there any scheme expression that will just get ignored when the scheme code is compiled? I'm generating some code with a function like: (define (gen-update-ab updatea updateb) `(begin ,(if updatea `(set! a (+ a 1)) `(donothing)) ,(if updateb `(set! b (+ b 1)) `(donothing)))) And ideally I could replace the donothing function with something that will get discarded during compilation. There are alternatives, but they're pretty ugly (significantly moreso in my actual code than they look below): (define (gen-update-ab-2 updatea updateb) `(begin ,@(if updatea `((set! a (+ a 1))) `()) ,@(if updateb `((set! b (+ b 1))) `()))) (define (gen-update-ab-3 updatea updateb) (filter (lambda (x) (not (null? x))) `(begin ,(if updatea `(set! a (+ a 1)) `()) ,(if updateb `(set! b (+ b 1)) `()))))