Jump to content

Active object: Difference between revisions

m
→‎classes: += now supported
No edit summary
m (→‎classes: += now supported)
Line 1,985:
=={{header|Phix}}==
===classes===
Needs 0.8.12+
<lang Phix>integer xlock = init_cs()
 
Line 2,007:
atom t1 = time(),
k1 = f(t1)
-- v += (t1 - t0) * (k1 + k0) / 2
-- (oops, '+=' not yet properly supported on class fields...)
-- v += (t1 - t0) * (k1 + k0) / 2
v = v + (t1 - t0) * (k1 + k0) / 2
t0 = t1
k0 = k1
Line 2,057 ⟶ 2,055:
4.049495114e-17
</pre>
 
===pre-classes===
Note that in Phix you cannot pass a variable to another procedure and have it "change under your feet". <small>[erm, now you can, see classes above]</small><br>
7,805

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.