Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion computed goto
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Frank DG1SBG  
View profile  
 More options Aug 10 2012, 9:07 am
Newsgroups: comp.lang.lisp
From: Frank DG1SBG <dg1...@googlemail.com>
Date: Fri, 10 Aug 2012 15:07:31 +0200
Local: Fri, Aug 10 2012 9:07 am
Subject: Re: computed goto

zermelo <zerm...@nospam.teletu.it> writes:
> I need to code something like this:
> (let ((n 2))
> (tagbody
>          (go n)
>          1 (print 1)
>          2 (print 2)))
> => expected 2

> Is there a way I can pass an expression to the go form?

> Thanks
> Ps
> I don’t need a ‘goto considered harmful’ sermon :)

Ahem - like this?

(defun print-value (value)
  (format *debug-io* "Value is ~s.~&" value))

(defun jump-on-value (value)
  (cond
    ((= value 1)
     (format *debug-io* "~%Hi there in 1.~&")
     (print-value value))
    ((= value 2)
     (format *debug-io* "~%Hi there in 2.~&")
     (print-value value))))

I'm pretty sure this isn't what you were looking for. So - what are you
looking for?

Frank


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.