Mercurial > repos > tabletprog
comparison samples/stringops.tp @ 150:7dfa4481deb0
Implement find:else on string objects
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 09 Aug 2013 10:05:20 -0700 |
parents | 27a2167663dd |
children | 3e9cb69e516d |
comparison
equal
deleted
inserted
replaced
149:7f442b3e4448 | 150:7dfa4481deb0 |
---|---|
1 #{ | 1 #{ |
2 main <- { | 2 main <- { |
3 print: "foo: " . 42 . "\n" | 3 print: "foo: " . 42 . "\n" |
4 print: (string: (length: "foo" . "bar")) . "\n" | 4 print: (string: (length: "foo" . "bar")) . "\n" |
5 print: (string: ("foobarbaz" find: "foo" else: { "not found" })) . "\n" | |
6 print: (string: ("foobarbaz" find: "bar" else: { "not found" })) . "\n" | |
7 print: (string: ("foobarbaz" find: "baz" else: { "not found" })) . "\n" | |
8 print: (string: ("foobarbaz" find: "qux" else: { "not found" })) . "\n" | |
5 } | 9 } |
6 } | 10 } |