Skip to content

Instantly share code, notes, and snippets.

@RTfXGaGeqSeItbMUgpFlekUs
Forked from duckinator/gist:436026
Created June 12, 2010 23:30
Show Gist options
  • Save RTfXGaGeqSeItbMUgpFlekUs/436180 to your computer and use it in GitHub Desktop.
Save RTfXGaGeqSeItbMUgpFlekUs/436180 to your computer and use it in GitHub Desktop.

Comments

  • /* */
  • //

Function Definition

function1 [str1 str2]:
  string (join " " [str1 str2])
  (print string)
;

function2 [list]:
  string (join " " list)
  (print string)
;

Function Calling

(function1 "foo" "bar")

Defining Variables

a-list ['abc' 'def']

Throwing It Together

# Define a-list
a-list ['abc' 'def']
/* the following combines each item in a-list with a space, and prints them */
(function2 a-list)
/* the following combines each item in ['foo' 'bar'] with a space, and prints them */
(function2 ['foo' 'bar'])

Notes

  • (foo bar baz) is a list, calling the function FOO with args BAR and BAZ
  • [foo bar baz] is a list, treated purely as data, like (quote (foo bar baz)) in Common Lisp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment