unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Michael Lucy <MichaelGLucy@Gmail.com>
To: No Itisnt <theseaisinhere@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: expression
Date: Wed, 23 Jun 2010 18:23:45 -0500	[thread overview]
Message-ID: <AANLkTimZDg1mZyS8wj7nVw6uGSaAP1p-zHzzeKOAolsU@mail.gmail.com> (raw)
In-Reply-To: <AANLkTintoGGkvt_Wuz_c3FLKcPzUYYuT-pUmPMCHXhTy@mail.gmail.com>

Doesn't look like it ignores it:

scheme@(guile-user)> ,c (begin (set! x 1))
Disassembly of #<objcode bdc6e48>:

   0    (assert-nargs-ee/locals 0)
   2    (make-int8:1)                   ;; 1
   3    (load-symbol "x")               ;; x
   8    (link-now)
   9    (variable-set)
  10    (void)
  11    (return)

scheme@(guile-user)> ,c (begin (set! x 1) *unspecified*)
Disassembly of #<objcode 9a05d08>:

   0    (assert-nargs-ee/locals 0)
   2    (make-int8:1)                   ;; 1
   3    (load-symbol "x")               ;; x
   8    (link-now)
   9    (variable-set)
  10    (load-symbol "*unspecified*")   ;; *unspecified*
  27    (link-now)
  28    (variable-ref)
  29    (return)

scheme@(guile-user)>

If it's idiomatic I'll do that till I find something else though.  Thanks!

On Wed, Jun 23, 2010 at 6:14 PM, No Itisnt <theseaisinhere@gmail.com> wrote:
> On Wed, Jun 23, 2010 at 4:09 PM, Michael Lucy <MichaelGLucy@gmail.com> wrote:
>> 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.
>
> I'm not sure if Guile will discard the result, but I think
> *unspecified* is the idiomatic value for those sorts of situations.
>



  reply	other threads:[~2010-06-23 23:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 21:09 expression Michael Lucy
2010-06-23 23:14 ` expression No Itisnt
2010-06-23 23:23   ` Michael Lucy [this message]
2010-06-24 13:01     ` expression Andy Wingo
2010-06-24  6:55 ` expression Ken Raeburn
2010-06-24  7:27   ` expression Thien-Thi Nguyen
2010-06-24  7:52   ` expression Michael Lucy
2010-06-24 13:05     ` expression Andy Wingo
2010-06-24 13:03   ` expression Andy Wingo
2010-06-24 14:40     ` expression Ken Raeburn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimZDg1mZyS8wj7nVw6uGSaAP1p-zHzzeKOAolsU@mail.gmail.com \
    --to=michaelglucy@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=theseaisinhere@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).