Data Types

StarLogo supports only a few data types: boolean, dlist, ilist, number, and symbol .

  • There are two booleans, true and false. There are no numeric equivalents to true and false. They must be referred to by name.

  • dlists are linked data lists, similar to lists in other versions of Logo. Unlike other Logos, however, StarLogo does not enable you to execute dlists as instructions (that is, there is no run command). You can create a dlist using the list or sentence commands, or by enclosing the literal elements in []'s. (i.e. setfamily [my mother is nice]). No elements inside dlist []'s are evaluated.

    Note: In this version of StarLogo turtles, patches, and the observer can access dlists.

  • Whenever you need to run a list of commands (i.e. if xcor > 0 [fd 50]), you use an ilist. ilists cannot be created at runtime like dlists; they must be written between [ ]'s in your code. All values inside an ilist are evaluated.

  • In StarLogo, numbers have a range that is determined by the version of Java that you are using. In Sun's Java this ranges from approximately -1*10^300 to 1*10^300, and decimals can go down to about 1*10^-300. Values smaller than 1*10^-300 return a value of 0, and values larger than 1*10^300 return a value of "Infinity".
  • symbols are used to refer to filenames and other strings. symbols are written as a string with a quotation mark " at the beginning and the end (i.e. "foo" or "myfile.txt").