Iterators example:
list array
for 1 < 10 (i)
array += "Element(${i})"
endfor
loop array (item)
say "Item: ${item}"
endfor
Comparing methods:
object o
method m(a)
return $0
end
end
method m(a)
return $0
end
if m("foobar") = o.m("foobar")
say "These methods return the same values."
say "You can compare return values to variable values as well."
else
say "This will never be seen."
endif
New string literal parsing system:
method get_host_address(host)
@host = $0
@ping ? "ping -n 1 \{@host}"
@ip = " ";@ip -= @ip
@start = false
loop @ping.size (char)
if @start = true
@ip += "${char}"
endif
if "${char}" = "["
@start = true
orif "${char}" = "]"
@start = false
endif
endfor
@ip -= "]"
remove @ping
remove @start
remove @host
return @ip
end
@hostname = "chomp.enter host name: "
@address = get_host_address(@hostname)
say "address: \{@address}"
clear_all!
I've updated the MediaWiki and you can find it under the "Hosted Apps" tab at the sourceforge link below.
To download 3.7.2, you can visit any of the following links:
sourceforge
freecode
No comments:
Post a Comment