How to exit out of a function ? what is try-catch-throw in terms of Program Counter
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Date: Oct 20, 2007 13:45

I have some code like this:

(if (test)
(exit)
(do something))

or

(if (test)
( do something)
(exit))

Various levels of nestings.

I have several questions, basic to sophisticated.

(1) What is the lisp equivalent idiom for (exit) as in bash or
in C.
(2) What is the best practice to handle this kind of problems?

(3) What is the intermediate practice to handle this kind of
problems.
Show full article (1.11Kb)
33 Comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Date: Oct 20, 2007 13:57

On Oct 20, 1:45 pm, gnuist...@gmail.com wrote:
> I have some code like this:
>
> (if (test)
> (exit)
> (do something))
>
> or
>
> (if (test)
> ( do something)
> (exit))
>
> Various levels of nestings.
>
> I have several questions, basic to sophisticated.
>
> (1) What is the lisp equivalent idiom for (exit) as in bash or
> in C.
> (2) What is the best practice to handle this kind of problems? ...
Show full article (1.33Kb)
no comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Author: Alf P. Steinbach
Date: Oct 20, 2007 15:55

* gnuist006@gmail.com:
> I have some code like this:
>
> (if (test)
> (exit)
> (do something))
>
>
> or
>
> (if (test)
> ( do something)
> (exit))
>
>
> Various levels of nestings.
>
> I have several questions, basic to sophisticated.
>
> (1) What is the lisp equivalent idiom for (exit) as in bash or ...
Show full article (2.45Kb)
no comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Author: Jim Langston
Date: Oct 20, 2007 18:08

gmail.com> wrote in message
news:1192913158.922454.108100@k35g2000prh.googlegroups.com...
>I have some code like this:
>
> (if (test)
> (exit)
> (do something))
>
>
> or
>
> (if (test)
> ( do something)
> (exit))
>
>
> Various levels of nestings.
>
> I have several questions, basic to sophisticated.
> ...
Show full article (3.55Kb)
no comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Author: Keith Thompson
Date: Oct 20, 2007 19:30

gnuist006@gmail.com writes:
> I have some code like this:
>
> (if (test)
> (exit)
> (do something))
>
>
> or
>
> (if (test)
> ( do something)
> (exit))

That's Lisp, yes? Saying so would be good, since we naturally assume
that anything posted to comp.lang.c is C.
Show full article (0.90Kb)
no comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Author: Malcolm McLean
Date: Oct 21, 2007 01:03

gmail.com> wrote in message
news:1192913158.922454.108100@k35g2000prh.googlegroups.com...
>I have some code like this:
>
> (if (test)
> (exit)
> (do something))
>
>
> or
>
> (if (test)
> ( do something)
> (exit))
>
>
> Various levels of nestings.
>
> I have several questions, basic to sophisticated.
> ...
Show full article (2.70Kb)
no comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Author: Kenny McCormack
Date: Oct 21, 2007 03:44

In article nuthaus.mib.org>,
Keith Thompson mib.org> wrote:
>gnuist006@gmail.com writes:
>> I have some code like this:
>>
>> (if (test)
>> (exit)
>> (do something))
>>
>>
>> or
>>
>> (if (test)
>> ( do something)
>> (exit))
>
>That's Lisp, yes? Saying so would be good, since we naturally assume
>that anything posted to comp.lang.c is C.
Show full article (0.63Kb)
no comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Author: santosh
Date: Oct 21, 2007 03:55

Kenny McCormack wrote:
Show full article (0.93Kb)
no comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Author: Malcolm McLean
Date: Oct 21, 2007 05:09

"Kenny McCormack" xmission.xmission.com> wrote in message
>
> Since all code used in the real world uses extensions, there is no C
> code in the real world.
>
Sort of true. You'll find a non-trivial program on my website to build fuzzy
logic trees. It is written in pure ANSI C89 except for one detail. The
comma-separated value file loader uses nan to indicate missing values.
Missing values are not allowed in the program, so it plays almost no part in
the main flow control. But it loads, checks for nans, and rejects if they
are present.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
no comments
Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter         


Author: Richard Heathfield
Date: Oct 21, 2007 05:26

[Followup corrected to clc]

santosh said:
> Kenny McCormack wrote:
>

>> Since all code used in the real world uses extensions, there is no C
>> code in the real world.
>
> Perhaps you mean to say that there are no C _programs_ in the real
> world.

Even if that's what he meant, he's still wrong.



--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
no comments

RELATED THREADS
SubjectArticles qty Group
Hypergeometric functions and beta functionssci.math ·
1 2 3 4