Jump to content

Recommended Posts

Posted

Hi All

 

Is it possible to end a lisp at any point of the result of an if is false? i.e.

 

(if (= 1 1) (do this) (else end defun))

Posted

IMO, I only use (exit) if I really have to - I try to write the program so that if something is false, then the rest of the program does not execute and just completes without forcing an error.

 

I am not sure what the consensus is on this, but thats my $0.02 :)

Posted

That's the classy way to do it, Lee. But, like so many things, there are a dozen (or two dozen) different ways of accomplishing the same task. I'd personally agree with you, I like having absolute control over where the data is flowing. That way, if something goes wrong, it's that much easier to track and fix. Then again, maybe I'd like to be absolutely certain that if something occurs, the function stops.

 

I think it harkens back to the BASIC code, where programmers would use "GOTO" in place of a While loop, and an If statement to "GOTO" somewhere outside the loop to end it.

 

I can't imagine ever needed to force an escape, but then again, I'd never imagine using a (grread) loop to dynamically capture and analyze user input data using a single prompt that gets altered based on user input. *whistles innocently*

Posted

I can't imagine ever needed to force an escape, but then again, I'd never imagine using a (grread) loop to dynamically capture and analyze user input data using a single prompt that gets altered based on user input. *whistles innocently*

 

I'd echo your opinions :)

 

** you and your grread fetish ** :P

Posted
I'd echo your opinions :)

 

** you and your grread fetish ** :P

 

Hey, you just wait. I've got something cooking and it's shaping up to be pretty sweet. Might take some time but it's looking real good.

Posted
Hey, you just wait. I've got something cooking and it's shaping up to be pretty sweet. Might take some time but it's looking real good.

 

cookies? 8)

Posted
cookies? 8)

 

None for you.

Posted
Hey, you just wait. I've got something cooking and it's shaping up to be pretty sweet. Might take some time but it's looking real good.

 

I look forward to it 8)

Posted
IMO, I only use (exit) if I really have to

 

I agree, but I was specifically answering this question:

 

Is it possible to end a lisp at any point...
Posted
I agree, but I was specifically answering this question:

 

I would have also answered in the same way :) - I just wanted a consensus on its usage :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...