Movatterモバイル変換


[0]ホーム

URL:


Newbie query - getting an interpreter using SPARK up and running ...

Andy Elveyandy.elvey at paradise.net.nz
Fri Apr 27 17:33:10 EDT 2001


Hi all .  I've been trying to get a little interpreter going which uses JohnAycock's package, SPARK.   The language I've chosen to try is Rebol , fortwo reasons - a) Rebol's syntax is simple , and ... b) Testing should be easy - the Rebol binary (which I have) is less thanhalf a meg to download. Sadly, no luck with my efforts so far!    What I'm trying to get going is a*small but central*  part of the language, as follows -Rebol consists of words, blocks and functions.  Examples - myword: "a nice little string"     anotherword: [ This word uses a block] and_yet_another_word: [ 'Alan':  '333-2354'                                        'fred:  '435-6453' ]    .  <- Thisword creates a block.Just by the way .... a word like fred:  is  a word of datatype set-word! inRebol.  The colon isn't an operator.If we have a word like  fred: 123   fred: gives the word a value -   123 .   'fred (with a single quote) returns the words name (fred here) but doesnot evaluate it .    fred  - This means to evaluate the word - it returns 123 here.   :fred - retrieve the words value , but don't evaluate it .  Often used torefer to functions or blocks without evaluating them.Blocks and rebol code can span multiple lines. Functions are defined like so :   sum: func [arg1 arg2] [arg1 + arg2]  . Are there any "SPARKatistas" out there who may be able to help?  I imaginethat anyone who's used SPARK for a while could get a simple littleinterpreter like the one above running in about an hour or so .....   The reason I'm doing this is to learn about Spark , but just like "ridinga bicycle" , I need a little "push" to get me underway ...:-)   Very manythanks for any help received.  Thanks for your time .


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp