On Wed, 29 Apr 2009 02:37:15 +0200, Yves Jaradin
<[email protected]> wrote:
>[...]
>
>So as to definitely confirm that this is an emacs error, and as a more
>reasonable workaround, you can try the following:
>1. Create a file BasicOPI.oz with the following content:
>
>functor
>import
> Open
> Application
>define
> P={Application.getArgs record(port(single type:int))}.port
> S={New class from Open.socket Open.text end client(port:P)}
> I={New class from Open.file Open.text end init(name:stdin)}
> O={New class from Open.file Open.text end init(name:stdout)}
> thread
> for X from fun{$}{S getS($)}end do
> case X
> of false then
> {Application.exit 0}
> else
> {O putS(X)}
> end
> end
> end
> Todo={NewCell nil}
> proc{DoIt}
> for X in {Reverse @Todo} do
> {S putS(X)}
> end
> {S putS([4])}
> end
> for X from fun{$}{I getS($)}end do
> case X
> of false then {Application.exit 0}
> [] "!" then {DoIt}
> [] "!\r" then {DoIt}
> [] "/" then Todo:=nil
> [] "/\r" then Todo:=nil
> else Todo:=X|@Todo
> end
> end
>end
>
>2. Compile it to an executable by issuing the command "ozc -x BasicOPI.oz"
>3. Open two terminals/command lines.
>4. In the first one, type "ozengine x-oz://system/OPI". This will gives
>you a banner message and a line of the form "'oz-socket xxxx yyyy'" with
>xxxx and yyyy being integers (actually port numbers).
>5. In the second one, run "BasicOPI --port xxxx" with the xxxx from the
>previous step. (You may have to prefix the line with "./").
>6.You can then type Oz code in the second terminal. Output that would go
>to the "*Oz Compiler*" buffer in the emacs-based OPI (such as compiler
>errors) will also get there. The first terminal corresponds to the "*Oz
>Emulator*" buffer and will display program output, execution errors,
>etc. and will also be the stdin of your program.
>
>Since many lines of Oz code might need to be fed at once, the code is
>not send for interpretation line-by-line but buffered until you type (in
>the second terminal) a line with just a single bang (!) which will feed
>the buffered line to the emulator or a single slash(/) which will drop
>the buffered lines (useful if you spot an error in a previous line).
>
>
>Since this uses the exact same code as the emacs-based OPI, it will only
>works if the problem is on the emacs side.
Thank you for your thorough response.
Your code works at the command line; _viz._:
Terminal 1:
>benja...@200706-05 /cygdrive/c/Documents and
>Settings/Benjamin/MyDocuments/Programming Practice/Mozart-Oz/Functions/Bug
>Test-related Files
>$ ozc -x BasicOPI.oz
>
>benja...@200706-05 /cygdrive/c/Documents and Settings/Benjamin/My
>Documents/Programming Practice/Mozart-Oz/Functions/Bug Test-related Files
>$ ozengine x-oz://system/OPI
>Mozart Engine 1.4.0 (20080703) playing Oz 3
>
>'oz-socket 1418 1419''Hello, World!'
>
Terminal 2:
>benja...@200706-05 /cygdrive/c/Documents and Settings/Benjamin/My
>Documents/Programming Practice/Mozart-Oz/Functions/Bug Test-related Files
>$ BasicOPI --port 1418
>bash: BasicOPI: command not found
>
>benja...@200706-05 /cygdrive/c/Documents and Settings/Benjamin/My
>Documents/Programming Practice/Mozart-Oz/Functions/Bug Test-related Files
>$ ./BasicOPI --port 1418
>Mozart Compiler 1.4.0 (20080703) playing Oz 3
>
>{Show 'Hello, World!'}
>!
>{Show 'Hello, World!'}
>% -------------------- accepted
>
According to your reasoning, the bug must now be on the Emacs side.
However, installing a new version of GNU Emacs/XEmacs (e.g., GNU Emacs
22.3.1 or XEmacs 21.4.21), running the corresponding addpm.exe file to
set the registry settings appropriately (in the case of GNU Emacs),
and setting the OZEMACS environmental variable accordingly does not
resolve this problem.
GNU Emacs does seem to work otherwise, however; for example, I can run
such commands as the following within Emacs without any problem:
M-x run-scheme
M-x bee-mode
M-x run-haskell
M-x ecb-activate
For some reason, the problem seems to be the connection between
ozengine.exe and Emacs, rather than either application by itself, even
though this does not seem to be a network problem; i.e., it seems to
be a problem with file permissions in ozengine.exe invoking Emacs.
Given this, in order to determine the cause of the bug, would it be
possible to verify whether this is indeed a file permissions-related
problem with ozengine.exe invoking Emacs, rather than a
network-related issue?
Thank you for all your time and effort; I greatly appreciate it.
-- Benjamin L. Russell
--
Benjamin L. Russell / DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile: +011 81 80-3603-6725
"Furuike ya, kawazu tobikomu mizu no oto."
-- Matsuo Basho^
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users