Last active
February 11, 2025 00:31
-
-
Save deathbeam/9b1a5d7165535165b037d2e6973ac4ff to your computer and use it in GitHub Desktop.
Spoon compiler test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env coffee | |
# Spoon code: | |
greet = name -> trace "Hello #{name}, how are you?" | |
greet "Person" | |
# Compiler result (fully working Haxe code): | |
# | |
# class Greet { | |
# static public function main() { | |
# var greet = function (name) return trace('Hello ' + name + ', how are you?'); | |
# greet('Person'); | |
# } | |
# } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In AS3 I might do greet like that but in Haxe I would use string interpolation.
var greet = function (name) return trace('Hello $name, how are you?');
see: http://try.haxe.org/#B5AB4 you also don't need the return keyword in this example.
http://haxe.org/manual/lf-string-interpolation.html
Not sure that it's an extensive enough example for your point to be validated, think it would be more useful to post maybe some 3d drawing or some xml parsing or something, best Justin