Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F624767
main.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
332 B
Referenced Files
None
Subscribers
None
main.rb
View Options
# example from "Beyond Java, p143"
# tested with Ruby 1.8.7 on Mac, does not work with 1.9 or JRuby 1.7
puts
"start !"
def
loop
for
i
in
1
..
5
do
puts
i
callcc
{
|
continuation
|
return
continuation
}
if
i
==
2
puts
".."
end
return
nil
end
cont
=
loop
();
puts
"part1 done"
cont
.
call
if
(
cont!
=
nil
)
puts
"part2 done"
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Nov 14, 10:42 PM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
138834
Default Alt Text
main.rb (332 B)
Attached To
Mode
R21 OOP Examples
Attached
Detach File
Event Timeline