, and I can watch some threads being
created, but the runaway threads seem to be coming from nowhere. Any ideas?
Thanks,
Lyle Kopnicky
declare GateMaker
fun {GateMaker F}
fun {$ Xs Ys}
fun {GateLoop Xs Ys}
case Xs#Ys of (X|Xr)#(Y|Yr) then
{F X Y}|{GateLoop Xr Yr
Here is my final working version:
declare GateMaker
fun {GateMaker F}
fun {$ Xs Ys}
fun {GateLoop Xs Ys}
case Xs#Ys of (X|Xr)#(Y|Yr) then
{F X Y}|{GateLoop Xr Yr}
end
end
in
thread {GateLoop Xs Ys} end
end
end
declare AndG OrG NandG NorG
for the last 100 distinct input values.
Regards,
Lyle Kopnicky
_
mozart-users mailing list
mozart-users@mozart-oz.org
http://www.mozart-oz.org/mailman/listinfo/mozart-users
Clarification to my last e-mail: the asymptotic space estimates for a cache
as a list are for MemoizeInLazyList, not MemoizeInList. MemoizeInList always
takes space proportional to the highest index that's been looked up so far.
- Lyle
Sounds reasonable to me. Maybe at some stage when the examples are clear and
complete, they can be fused into the documentation.
On Tue, Feb 16, 2010 at 7:54 AM, mark richardson mrath...@googlemail.comwrote:
Hi everyone,
I hope this isn't going to spark a storm of controversy.
In the past,
Hi folks,
I wonder if I'm missing something in the definition of functors. According
to CTM (pp. 221), A functor is a function whose arguments are the modules
it needs and shose result is a new module. That sounds wonderful, as it
allows me to compose modules at will. On pp. 223-4, the following
Yes, but will that work in a standalone .ozf file?
- Lyle
On Tue, Jul 27, 2010 at 3:26 PM, Torsten Anders
torsten.and...@plymouth.ac.uk wrote:
Dear Lyle,
you could write a (normal) function that creates and returns a functor --
the functor syntax is nestable and thus can also be wrapped in
Thanks, Wolfgang and Torsten! I see that although functors are not allowed
to take parameters in Oz (as they can in ML), there are several workarounds.
On Wed, Jul 28, 2010 at 4:42 PM, Wolfgang Meyer
wolfgang.m.me...@googlemail.com wrote:
Hi,
I think that definition of functor on pp. 221 of
Hi folks,
I was working Exercise 6 in Chapter 5 of CTM, and I came across a couple of
issues.
First of all, I think the last *else* line in Figure 5.22 (p. 393) needs an
*end* after it.
Secondly, contrary to Exercise 6a, I do not think the second form reduces to
the third form when the time-out
One more small erratum in CTM:
On page 402, in the Replace function, the phrase andthen A=B should be
andthen A==B. Otherwise it freezes the thread. Found that out after a lot
of trial and error. :)
- Lyle
_
I would like to help but have no idea about that stuff... still finishing
Chapter 6 of CTM, so I haven't got to the OO or GUI chapters yet.
- Lyle
_
mozart-users mailing list
Hi Kurt,
A function is syntactic sugar for a procedure that takes an extra argument
to which the return value is bound. Since Inc is declared with 'fun' it
expects two arguments: the amount by which to increment, and the return
value: the resulting total. You can pass this extra argument (which
Hi Kurt,
Your recursive call needs to pass along a carry bit. Try defining a version
of Add (say AddWithCarry) that takes a carry bit. Then define Add to call
AddWithCarry with an initial carry bit of 0.
AddWithCarry could be publicly visible, or just defined locally inside of
Add.
- Lyle
Hi folks,
I was getting an error in a program, and I've distilled it down to a tiny
program to reproduce it:
declare U
U={Record.toDictionary o(f:{NewCell nil})}
U.f := @(U.f)
U.f := @(U.f)
When this code is run, it produces the error:
%*** type error
Thanks, Carlos.
It seems there a syntactic ambiguity here. When I write U.f := ..., it could
mean either that I want to put a new value in the dictionary slot f of U, or
that I want to retrieve the cell U.f and then put a new value in that cell.
Is there a way to disambiguate in the syntax?
I
Hi Peter,
When accumulating you will still have to do the multiplications in the same
order. If you want to accumulate a list of the intermediate steps, you
cannot start with the bigger numbers and multiply down to the smaller
numbers. The recursion is masking the fact that the smaller numbers
Well, sorry, now I've gone and ruined your assignment. Ignore my message and
read Raphael's. :)
- Lyle
_
mozart-users mailing list
mozart-users@mozart-oz.org
Hi folks,
I downloaded Mozart for Mac OS X and tried to run the program. When it
started, it complained that it couldn't find Aquamacs, that I should
download and install that. So I downloaded Aquamacs and installed it.
Aquamacs works fine. It's in my Applications folder.
Then I copied Mozart to
On Wed, Sep 29, 2010 at 11:10 AM, Carlos Ramirez calr...@gmail.com wrote:
But, if you want modify the value in the cell, you could write:
(U.f) := new_value
OK, that does work, after all. I thought I had tried that. Thanks, Carlos!
- Lyle
Hi folks,
I downloaded Mozart for Mac OS X and tried to run the program. When it
started, it complained that it couldn't find Aquamacs, that I should
download and install that. So I downloaded Aquamacs and installed it.
Aquamacs works fine. It's in my Applications folder.
Then I copied Mozart to
Good instructions! Basically the same instructions also work for XP and
Vista. Except on 32-bit systems you don't need the ' (x86)' after Program
Files. (I used to use 32-bit XP and Vista and am now on 64-bit 7 myself.)
The only thing I do differently is that I prefer the standard emacs:
Yes, that's correct. Strings are represented as lists of characters, and
characters are just small integers. It's unfortunate that strings don't
Browse more readably. You can call StringToAtom on it to see something more
readable.
On Mon, Jan 3, 2011 at 3:20 PM, Khadija EL MAHRSI
You can also convert a VirtualString directly to an Atom via
VirtualString.toAtom.
On Mon, Jan 3, 2011 at 9:35 PM, Lyle Kopnicky li...@qseep.net wrote:
Yes, that's correct. Strings are represented as lists of characters, and
characters are just small integers. It's unfortunate that strings
One thing left out of this discussion is that there are ByteStrings. I
appreciate that! So there really is no need for a separate String type that
isn't a list. I still think it would be nice to have a Char type though,
hopefully Unicode. Lists of Chars would be nice to work with.
Most uses of
Mozart, you may also download a binary
dll replacement from here:
http://code.google.com/p/oz-code/downloads/list
I'm not sure whether I ever tested this with Windows 7, but with XP it
certainly worked.
Cheers,
Wolfgang
On Thu, Mar 3, 2011 at 8:24 AM, Lyle Kopnicky li...@qseep.net wrote
Hi folks,
I'm studying the Remote module and am getting some unexpected errors. I've
produced this tiny example to illustrate:
functor RemoteProc
import
OS
export
Pid
GetPID
define
fun {GetPID}
{OS.getPID}
end
Pid={OS.getPID}
end
RP1={New Remote.manager init}
RS1={RP1
Hmm... those problems were on Windows. I'm using Wolfgang's remoting patch.
I tried the same program on a Mac to see if it would work better.
Unfortunately, it didn't even work with the second-to-last line commented
out:
Mozart Engine 1.4.0 (20080703) playing Oz 3
%** Error:
That makes perfect sense. Thanks for the explanation.
Wouldn't it make sense for sited resources themselves to be annotated as
stationary automatically? Why would you ever want a sited resource to be run
from another location, when it would just cause an error?
Thanks,
Lyle
If anyone has a solution to the Mac issue, I'd love to hear that, too.
On Fri, Mar 11, 2011 at 11:17 AM, Lyle Kopnicky li...@qseep.net wrote:
Hmm... those problems were on Windows. I'm using Wolfgang's remoting patch.
I tried the same program on a Mac to see if it would work better
Hmm, OK. It does say on the web documentation that once a variable is bound
to a value, the fault stream is closed. Certainly it shouldn't crash if I
try to kill it, but I guess it doesn't make sense to do that.
_
Hi folks,
I'm working through the constraint problems in Chapter 12 of CTM. Problem #2
involves finding the prices which, when summed equal $7.11, and when
multiplied also equal $7.11. I wrote the following solution:
proc {Grocery ?Sol}
sol(Item1 Item2 Item3 Item4)=Sol
in
Item1::1#711
I see, it's impossible to statically enforce some types when they could be
assigned dynamically in some other lexical scope. Thanks!
On Wed, Jul 13, 2011 at 4:36 AM, Torsten Anders
torsten.and...@plymouth.ac.uk wrote:
If you give a propagator an unbound variable then the compiler must not
Hi Benoit,
What you call 'snippets' are called 'abbrevs' in emacs.
http://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html
- Lyle
_
mozart-users mailing list
33 matches
Mail list logo