EXIT Question



!end is used in “adagio” to mark the end of a score. http://www.audacity-forum.de/download/edgar/nyquist/nyquist-doc/manual/part9.html#index750

I totally agree with your reasoning. This was one of the main points that I raised in an earlier post concerning the usefulness of structured programming.

In BASIC, depending on the dialect, structuring code can be quite limited. For example, some dialects do not allow the programmer to write their own procedures. Procedures and functions are methods, implemented in some later versions of BASIC, of creating structured flow control, thus avoiding cumbersome and inefficient complex GOTO branching (often referred to as “spaghetti code”)

Nyquist inherits from XLisp the facility to structure code in several useful ways.
For example: Nyquist supports block structures such as LET, conditional block structures such as DO and WHILE, and user defined functions.

In this example, you are wanting to skip the code that follows this statement.
Or put another way, the code that follows this statement should only be run IF (= X Y) is false, so the “block” of code that follows this line should be run conditionally.

(IF (= X Y) (EXIT)
{run this block of code


A simple and efficient way to structure this would be to write that block of code as a function.

(defun block_of_code ()


Then you can call that function (run that code) conditionally:

(if (/= X Y) (block_of_code)) ; if x is not equal to y, run the block of code, otherwise don’t


Nyquist is a high level scripting language. If you wish to do low level programming then Nyquist is not the language for you.