Dwood
October 23rd, 2009, 04:26 PM
It has come to my attention that Halo Script has some odd attributes to it that no one to my knowledge explores/takes advantage of.
Let's take a look at the Halo Scripting Bible (http://www.freewebs.com/desphm/HS_Bible.htm)
The main thing I would like to point out is the top part of HSB:
' quote
The quote character is used to block LISP evaluation. When LISP evaluates a quoted thing the quote is "stripped off" and the expression following the quote is returnd.
? (+ 3 4) ; LISP evalutates the list
7
? '(+ 3 4) ; quote blocks evaluation
(+ 3 4) ; the quote is stripped off
? PI ; LISP evalutates the symbol
3.141592653589793
? ''PI ; the first quote is stripped off
'PI ; leaving the second quote intact
: colon
The colon introduces a special type of symbol called a keyword. A keyword is self-evaluating, that is, it is constant data.
? :woof-woof!
:WOOF-WOOF!
# cross
The cross character is used to introduce a special interpretation of the subsequent expression. Here are several examples:
#xFF00
Introduces digits in hexidecimal radix.
#(1 2 3)
Creates a vector (array) from a list of elements.
#'list
Returns the function associated with the symbol list. If no function is associated with the symbol LISP signals an error.
#|
Introduces a comment that lasts more than one line. A #| must be balanced by a terminating |#.
One of the first things I don't get, are the practical uses of the ' character in Halo Script.
Then, I think there's something that's even more useful but I just don't understand its uses are, is the colon.
and Third, something that I don't understand is how to use an array in LISP as HSB defines:
#(1 2 3) - wait, what?
like, could I use an array of script functions so I could say
array = #(scriptFunct1 scriptFunct2 scriptFunct3)
then in my script:
(begin_random array) ?
Or should I not even be looking at the Halo Script Bible?
Let's take a look at the Halo Scripting Bible (http://www.freewebs.com/desphm/HS_Bible.htm)
The main thing I would like to point out is the top part of HSB:
' quote
The quote character is used to block LISP evaluation. When LISP evaluates a quoted thing the quote is "stripped off" and the expression following the quote is returnd.
? (+ 3 4) ; LISP evalutates the list
7
? '(+ 3 4) ; quote blocks evaluation
(+ 3 4) ; the quote is stripped off
? PI ; LISP evalutates the symbol
3.141592653589793
? ''PI ; the first quote is stripped off
'PI ; leaving the second quote intact
: colon
The colon introduces a special type of symbol called a keyword. A keyword is self-evaluating, that is, it is constant data.
? :woof-woof!
:WOOF-WOOF!
# cross
The cross character is used to introduce a special interpretation of the subsequent expression. Here are several examples:
#xFF00
Introduces digits in hexidecimal radix.
#(1 2 3)
Creates a vector (array) from a list of elements.
#'list
Returns the function associated with the symbol list. If no function is associated with the symbol LISP signals an error.
#|
Introduces a comment that lasts more than one line. A #| must be balanced by a terminating |#.
One of the first things I don't get, are the practical uses of the ' character in Halo Script.
Then, I think there's something that's even more useful but I just don't understand its uses are, is the colon.
and Third, something that I don't understand is how to use an array in LISP as HSB defines:
#(1 2 3) - wait, what?
like, could I use an array of script functions so I could say
array = #(scriptFunct1 scriptFunct2 scriptFunct3)
then in my script:
(begin_random array) ?
Or should I not even be looking at the Halo Script Bible?