Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boyscout: clean up ootr example #102

Merged
merged 1 commit into from
Feb 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions experiments/threadring/ootr.enc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ class Main
first = new Agent(i)
next = null : Agent
n = 50*1000*1000
N = i + 503
i = i + 1
N = 503
cur = first
in {
while (i < N) {
i = i + 1;
next = new Agent(i);
cur.setNext(next);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertnetymk is there any reason why we want to use . instead of !?

cur = next;
i = i + 1;
};
cur.setNext(first);
first.run(n);
Expand All @@ -34,10 +33,8 @@ class Agent

def run(n : int): void {
if (n > 0) then {
this.next!run(n-1);
();
this.next ! run(n-1)
} else {
print this.id;
();
print(this.id)
}
}