Graham Percival wrote:
I attempted to follow those instructions, and looked for other
mailist replies, but am still unable to create a working "hello
world" program which works in both command-line and in the OPI.
Based on that FAQ, I created this:
%% ozc -x hello.oz
%% ./hello
declare
functor Foo
import
System Application
define
{System.showInfo 'hello world'}
{Application.exit 0}
end
[FooModule] = {Module.apply [Foo]}
which dies in the OPI with a
Process *Oz Compiler* connection broken by remote peer
Hi Graham,
You observed that message in the *Oz Compiler* because you killed the oz
emulator with the {Application.exit 0} statement. If you run the same in the
OPI, and you check the *Oz Emulator* buffer, you will see your 'hello world'
message as follows:
---------------------
hello world
Process Oz Emulator finished
---------------------
Anyway, I still don't understand the utility of "ozc -e file.oz". Running that
on a terminal you get:
%********************* binding analysis error *******************
%**
%** variable Module not introduced
%**
%** in file "./forozce.oz", line 10, column 7
%** ------------------ rejected (1 error)
Of course, this works on the OPI because it loads the Module for you...
so, anybody an idea about when to use "ozc -e"??
cheers
Boriss
OTOH, I've now discovered that I don't need to use the OPI to use
the Browser and Explorer, so I might abandon the OPI entirely and
only use command-line programs... in which case the answer to this
question doesn't matter. However, it would be nice if there was a
complete, working, "hello world" example somewhere.
Cheers,
- Graham
On Fri, 14 Mar 2008 19:09:55 -0600
"Robert Van Dam" <[EMAIL PROTECTED]> wrote:
Here's the succinctest answer I know of:
http://www.vendian.org/oz/wiki/index.cgi?FAQ#Compiler_error_illegal_use_of_nesting_marker_at_the_top_of_a_functor
On 3/13/08, Graham Percival <[EMAIL PROTECTED]> wrote:
Greetings,
I've used Oz for a few months in the OPI, but now I'm trying to
generate stand-alone programs so I can start them with scripts.
This code works fine:
%% ozc -x hello.oz
%% ./hello
functor
import
System Application
define
{System.showInfo 'hello world'}
{Application.exit 0}
end
However, when I run the code with
ozc -e hello.oz
I get this message:
Mozart Compiler 1.3.2 (20071210) playing Oz 3
%%% feeding file hello.oz
%************************* expansion error **********************
%**
%** illegal use of nesting marker
%**
%** in file "./hello.oz", line 4, column 0
%** ------------------ rejected (1 error)
What's the diffence between "-e" and "-x followed by ./filename" ?
And more to the point, what's the illegal nesting marker? What's
the proper way to create "hello world" ?
Cheers,
- Graham
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users