Toyokazu Tomatsu
Posts: 66
Nickname: tomatsu
Registered: Jul, 2003
Toyokazu Tomatsu is a developer of Pnuts.
|
|
|
|
Pnuts Updates (Additional useful functions, etc.)
|
Posted: Sep 1, 2004 9:54 PM
|
|
Advertisement
|
Changes in 20040807(1.1beta,1.0rc2)
- 1. String can be used in for statement to get the characters.
for (i : "abc") println(i)
a
b
c
- 2. String->integer Conversion with int(str, radix)
int("20", 16) --> 32
- 3. The return type of matchAll(pattern, input) is changed to Iterator.
for (i : matchAll(".", input)) println(i)
matchAll(".", "ABC", null) --> 3
- 4. When aggregateMode(true) has been called, the binary operations (+, -, *) are defined for java.util.Set.
aggregateMode(true)
s1 = set([1,2,3])
s2 = set([1,3,5])
s1 + s2 --> [1,2,3,5]
s1 - s2 --> [2]
s1 + 10 --> [1,2,3,10]
s1 - 1 --> [2,3]
s1 * s2 --> [1, 3]
- 5. isGenerator() is added to pnuts.lib module (1.1 only)
- 6. setCharacterEncoding(), getCharacterEncoding() is added to pnuts.io (1.1 only)
Default character encoding can be set/retrieved.
setCharacterEncoding("UTF-8")
txt = readText(open("foo.txt"))
- 7. prototype() (in metaobject module) can be created based on a Java object.
use("metaobject")
p = prototype(date())
p.getTime()
- 8. Miscellaneous
- 9. Bug fixes:
Read: Pnuts Updates (Additional useful functions, etc.)
|
|