This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blah |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"123-456-hello" case-of: { | |
/(\d+)-(\d+)-(?<foo>\w+)/ -> | |
{ \0 print -- prints 123-456-hello | |
\1 print -- prints 123 | |
foo print -- prints hello (\2 available too?) | |
} call | |
} | |
"123-456-hello" replace: /(\d+)-(?<foo>\w+)/ with: { | |
foo .. "-" .. \1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- standard Perl | |
toOpt 'm' = return compMultiline | |
toOpt 's' = return compDotAll | |
toOpt 'i' = return compCaseless | |
toOpt 'x' = return compExtended | |
-- additional | |
toOpt 'a' = return compAnchored | |
toOpt 'G' = return compUngreedy | |
toOpt 'e' = return compDollarEndOnly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0]> { a = 1 | |
.... @(a: a) print | |
.... a + 1 | |
.... } call | |
@(a: 1) | |
2 | |
[1]> 1 + | |
.... 2 | |
3 | |
[2]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0]> A = Object clone | |
<object (delegates to 1 object)> | |
[1]> B = Object clone | |
<object (delegates to 1 object)> | |
[2]> C = Object clone | |
<object (delegates to 1 object)> | |
[3]> A2 = Object clone | |
<object (delegates to 1 object)> | |
[4]> A2 = A clone | |
<object (delegates to 1 object)> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0]> a x: b &c: 2 := a + b + c | |
@ok | |
[1]> 1 x: 2 | |
5 | |
[2]> 1 x: 2 &c: 3 | |
6 | |
[3]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0]> (a x: b &c: 2) := a + b + c | |
@ok | |
[1]> 1 x: 2 | |
5 | |
[2]> 1 x: 2 &c: 3 | |
6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0]> 0.28 rationalize | |
7/25 | |
[1]> 0.28 rationalize: 0.1 | |
1/3 | |
[2]> 0.28 rationalize: 0.01 | |
2/7 | |
[3]> 0.28 rationalize: 0.001 | |
7/25 | |
[4]> 0.28 rationalize: 0.2 | |
1/3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@(foo: a) matches @(foo: 2), binding a as 2 | |
@(foo: 2) matches @(foo: 2) | |
@(foo: _) matches @(foo: 2) | |
@(foo: _) matches @(foo: _) | |
@(foo: a) SHOULD NOT MATCH @(foo: _) (I just checked, and it *does* match atm, but it doesn't bind a as anything) | |
@(foo: 2) DOES NOT MATCH @(foo: _) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~~> x = reference to x | |
=> = direct value | |
before: | |
Reference (~~> Object { oDelegates => [Value], oMethods => (MethodMap, MethodMap) }) | |
- match, comparePrecision, etc. need to use unsafePerformIO to check delegates, | |
or be locked into the IO monad | |
- @join:/@do: needed to be careful with the target's delegates; they would make a dummy |