Executing Mozart-Oz code in command line -
i'm trying use mozart oz. download execution binary source forge: http://sourceforge.net/projects/mozart-oz/.
when launching mozart.app, emacs (aquamacs mac os x) starts coding within it.
for example, can type in {browse 'hello world'}
, execute oz -> feed buffer
result in tcl/tk browser.
then, how can build or execute oz code in command line python or ruby?
i found binaries in bin directory.
/applications/mozart2.app/contents/resources/bin ├── oz ├── ozc ├── ozemulator ├── ozengine └── ozwish
however, when execute code ozc -c hello.oz
, got %** variable browse not introduced
error. might wrong?
you must use browser.browse
actually, every function must imported/created when building application in oz. when import browser, record functions browser object class export. (see https://mozart.github.io/mozart-v1/doc-1.4.0/browser/node2.html)
thus, code is
functor import browser define {browser.browse 'hello world'} end
i should exit application {application.exit 0} gives me weird error... anyway, recommend not use browser. if it's powerful when using interactive interpreter, it's heavy , buggy. use system.showinfo instead, , build own tk window if want one.
functor import system application define {system.showinfo 'hello world!'} {application.exit 0} end
you compile with
$ ozc -c hello.oz
and run with
$ ozengine hello.ozf
Comments
Post a Comment