Tag: coffeescript textmate

从`咖啡`可执行文件调用函数

原谅noob问题,但是为什么我不能从coffee REPL(或者从TextMate中编写和运行的文件)调用(几乎)任何标准函数? variables赋值工作,函数不。 例子: coffee> string = "string" 'string' coffee> list = [1,2,3] [ 1, 2, 3 ] coffee> num = 42 42 coffee> opposite = true true coffee> num = -42 if opposite -42 但 coffee> alert "Hello, World" ReferenceError: alert is not defined at repl:1:5 at REPLServer.replDefaults.eval (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/repl.js:33:28) at repl.js:239:12 at Interface.<anonymous> (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/repl.js:62:9) […]