[Oz] Locking cells by default
Luis Omar Quesada Ramirez
luis_omar_quesada at yahoo.com
Wed Dec 20 05:06:45 CET 2000
Hi,
I am defining the fields of a tuple concurrently. I am
using a cell for this purpose so whenever a field is
defined I just append that field to the ones already
defined that are in the cell (line 6 of my code).
The problem with this is that after appending all the
fields there are some of them that are missing. For
example, fields 1948 2000 do not appear whatsoever .
I suppose this is because I am not locking the cell
when adding a new field but my questions are: why are
not cells locked by default? When does one want them
unlocked?
1. local
2. Top=2000
3. File Pointer Flag
4. T={NewCell '#'}
5. P=proc {$ I}
6. {Assign T {Tuple.append {Access T} '#'(I#'\n')}}
7. if I==Top then Flag=true else skip end
8. end
9. in
10. {For 1 Top 1 proc {$ I}
11. thread {P I} end
12. end}
13. thread14. {Wait Flag}
15. class File from Open.text Open.file end
16. Pointer = {New File init(name:'registro.dat'
flags:[read 17. write create truncate])}
18. {Pointer write(vs:{Access T})}
19. {Pointer close}
20. end
21. end
I am sending copy of files.
Cheers,
Luis
_________________________________________________________
Do You Yahoo!?
Obtenga su dirección de correo-e gratis @yahoo.com
en http://correo.espanol.yahoo.com
-------------- next part --------------
local
Top=2000
File Pointer Flag
T={NewCell '#'}
P=proc {$ I}
{Assign T {Tuple.append {Access T} '#'(I#'\n')}}
if I==Top then Flag=true else skip end
end
in
{For 1 Top 1 proc {$ I}
thread {P I} end
end}
thread
{Wait Flag}
class File from Open.text Open.file end
Pointer = {New File init(name:'registro.dat' flags:[read write create truncate])}
{Pointer write(vs:{Access T})}
{Pointer close}
end
end
-------------- next part --------------
A non-text attachment was scrubbed...
Name: registro.dat
Type: application/octet-stream
Size: 6780 bytes
Desc: registro.dat
Url : http://lists.gforge.info.ucl.ac.be/pipermail/mozart-users/attachments/20001219/7ceb500d/registro.obj
More information about the mozart-users
mailing list