15.3 Ifdef Example

15.3.1 Source file (various/ifdef.cws)

<h1> This is a minimal example about ifdef statement </h1>

<h2> Simple ifdef statement </h2>

<cows>

dummy_var = "variable's content doesn't matter";

// dummy_var has been defined so the statements block will be executed

ifdef (dummy_var) {
  print ("<p> People often say that humans have always eaten animals,");
  print ("as if this is a justification for continuing the practice.");
  print ("According to this logic, we should not try to prevent");
  print ("people from murdering other people, since this has also");
  print ("been done since the earliest of times. <br>");
  print ("-- Isaac Bashevis Singer\n");
}

</cows>

<h2> ifdef / else statement </h2>

<cows>

// dummy_var has been defined so the first statements block will be
// executed. The `else' block won't be executed

ifdef (dummy_var) {
  print ("<p> Heifer whines could be human cries  <br>");
  print ("Closer comes the screaming knife        <br>");
  print ("This beautiful creature must die        <br>");
  print ("This beautiful creature must die        <br>");
  print ("A death for no reason                   <br>");
  print ("And death for no reason is MURDER       <br>");
  print ("-- Smiths\n");
} else {
  print ("<p> Suppose that tomorrow a group of beings from another");
  print ("planet were to land on Earth, beings who considered");
  print ("themselves as superior to you as you feel yourself to be to");
  print ("other animals. Would they have the right to treat you as you");
  print ("treat the animals you breed, keep and kill for food? <br>");
  print ("-- John Harris\n");
}

// Now, the same ifndef/else statement above; this time we undefine
// dummy_var, so the `else' block will be executed

undef (dummy_var);

ifdef (dummy_var) {
  print ("<p> Heifer whines could be human cries  <br>");
  print ("Closer comes the screaming knife        <br>");
  print ("This beautiful creature must die        <br>");
  print ("This beautiful creature must die        <br>");
  print ("A death for no reason                   <br>");
  print ("And death for no reason is MURDER       <br>");
  print ("-- Smiths\n");
} else {
  print ("<p> Suppose that tomorrow a group of beings from another");
  print ("planet were to land on Earth, beings who considered");
  print ("themselves as superior to you as you feel yourself to be to");
  print ("other animals. Would they have the right to treat you as you");
  print ("treat the animals you breed, keep and kill for food? <br>");
  print ("-- John Harris\n");
}

</cows>

<hr> See G-Cows manual for further details

15.3.2 Resulting HTML file

<h1> This is a minimal example about ifdef statement </h1>

<h2> Simple ifdef statement </h2>

<p> People often say that humans have always eaten animals,
as if this is a justification for continuing the practice.
According to this logic, we should not try to prevent
people from murdering other people, since this has also
been done since the earliest of times. <br>
-- Isaac Bashevis Singer



<h2> ifdef / else statement </h2>

<p> Heifer whines could be human cries  <br>
Closer comes the screaming knife        <br>
This beautiful creature must die        <br>
This beautiful creature must die        <br>
A death for no reason                   <br>
And death for no reason is MURDER       <br>
-- Smiths

<p> Suppose that tomorrow a group of beings from another
planet were to land on Earth, beings who considered
themselves as superior to you as you feel yourself to be to
other animals. Would they have the right to treat you as you
treat the animals you breed, keep and kill for food? <br>
-- John Harris



<hr> See G-Cows manual for further details

15.3.3 Resulting HTML file viewed with the Lynx text-browser


                This is a minimal example about ifdef statement

Simple ifdef statement

   People often say that humans have always eaten animals, as if this is
   a justification for continuing the practice. According to this logic,
   we should not try to prevent people from murdering other people, since
   this has also been done since the earliest of times.
   -- Isaac Bashevis Singer

ifdef / else statement

   Heifer whines could be human cries
   Closer comes the screaming knife
   This beautiful creature must die
   This beautiful creature must die
   A death for no reason
   And death for no reason is MURDER
   -- Smiths

   Suppose that tomorrow a group of beings from another planet were to
   land on Earth, beings who considered themselves as superior to you as
   you feel yourself to be to other animals. Would they have the right to
   treat you as you treat the animals you breed, keep and kill for food?
   -- John Harris
     _________________________________________________________________

   See G-Cows manual for further details

This manual can be downloaded from http://www.g-cows.org/.