| No. | Code | Execution | Target |
|---|---|---|---|
| 7. | <-- [=foo] --> <br/> [=bar()] |
hello~ good good |
hello~ good good |
| 9.1. | [@ range(1,2)] [@ range(3,5)] [=.v] x [=..v] = [=.v *..v]<br/> [/] [/] |
1 x 3 = 3 1 x 4 = 4 1 x 5 = 5 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 |
1 x 3 = 3 1 x 4 = 4 1 x 5 = 5 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 |
| 9.2.1. | <ul> [@ countries] <li> [=.name] [=.pop] million <ul> [@ .cities] <li> [=..name] [=..pop] million ([= ..pop / .pop * 100]%) </li> [/] </ul> </li> [/] </ul> |
|
|
| 9.2.2. | [@ foo1] [@ bar1] [=.v] x [=..v] = [=.v *..v] <br/> [/] [/] |
1 x 3 = 3 1 x 4 = 4 1 x 5 = 5 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 |
1 x 3 = 3 1 x 4 = 4 1 x 5 = 5 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 |
| 10.1. | [@ {'a':'apple', 'b':'banana', 'c':'cherry'}] [=.i+1]/[=.s]. [=.k]: [=.v] <br/> [/] |
1/3. a: apple 2/3. b: banana 3/3. c: cherry |
1/3. a: apple 2/3. b: banana 3/3. c: cherry |
| 10.2.1. | [@ ['apple', 'banana', 123:'cherry']] [=.s - .i]. [=.k]: [=.v] <br/> [/] |
3. 0: apple 2. 1: banana 1. 123: cherry |
3. 0: apple 2. 1: banana 1. 123: cherry |
| 10.2.2. | [@ {1, 2}] [@ {3, 4, 5}] [=.v] x [=..v] = [=.v *..v] <br/> [/] [/] |
1 x 3 = 3 1 x 4 = 4 1 x 5 = 5 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 |
1 x 3 = 3 1 x 4 = 4 1 x 5 = 5 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 |
| 11.1. | [=fooo[3]] [=fooo{3}] | 4 4 | 4 4 |
| 11.2. | [=user.name], [=user.age], [=user.hobbies.second] | Cratee, 56, running | Cratee, 56, running |
| 12.1. | [=user2.name], [=user2.age], [=user2.hobbies.first] | Kitty, 25, running | Kitty, 25, running |
| 12.2. | [=xx.bar()]<br/> [=yy.baz] |
return from method. from array |
return from method. from array |
| 12.3. | [=zz.baz().bar()] | return from method. | return from method. |
| 12.4. | [@ product] [=.code()] [=.name()] [=.v.price()]<br/> [/] |
001 vitamin $100.00 002 shoes $123.00 |
001 vitamin $100.00 002 shoes $123.00 |
| 13.1.1. | [=MY_CONST] | 111 | 111 |
| 13.1.2. | [@ MY_CONST_ARRAY][=.k]:[=.v]<br/>[/] |
a:1 b:2 c:3 |
a:1 b:2 c:3 |
| 13.2. | [=Foo.bar()]<br/> [=Foo.ITEMS_PER_PAGE]<br/> [=Bar.baz.bar()]<br/> [=Bar.baz.ITEMS_PER_PAGE]<br/> |
from static method. 30 from namespace function 50 |
from static method. 30 from namespace function 50 |
| 13.3. | [= Widget.Calender.draw()]<br/> [= Widget.Calender.MONTH.march]<br/> |
달력위젯이 그림 3 |
달력위젯이 그림 3 |
| 14.1.1. | [=this.get('sub.html')] |
4 4
|
4 4
|
| 14.1.2. | [=Tpl.get( 'sub.html', {'fooo':{3,4,5,6,7,8}} )] |
6 6
|
6 6
|
| 14.2.1. | [=this.fetch(sub)] |
4 4
|
4 4
|
| 14.2.2. | [=sub2] |
11 11
|
11 11
|
| 15. | [?foo2][=bar2][:]baz[/]<br/> [= foo2 ? bar3 : "baz"]<br/> [= foo ?: "bar"]<br/> [= foo3 ?? "bar"]<br/> [= foo3 ?: bar() ?: "baz"]<br/> [= foo ? (bar ? 'foobar' : 'foo') : 'no'] |
Tplus if ternary operator hello~ bar good good foobar |
Tplus if ternary operator hello~ bar good good foobar |
| 17. | [=this.assign({'foo':123})] [=this.assign({'foo':456,'bar':'bbb'})] [=foo] [=bar] | 456 bbb | 456 bbb |
| 19. | [=ucfirst( bar + "baz" + caz )] | Bbbbazzzz | Bbbbazzzz |
| 20. | [@ {}] [=.v] [:] foo empty [/]<br/> [? fruit == 'apple' || fruit == 'cherry'] red [: fruit == 'blueberry' || pants=='jeans'] blue [:] unkown [/] |
foo empty
blue |
foo empty
blue |
| 21. | [= "abcde".toUpper() ] <br/> [= "abcde".length() ] <br/> [= {2,5,8}.average() ] <br/> [= "abcde".toUpper().substr(1,3)] <br/> [= article.esc().nl2br()] <br/> [= GLOBALS.me.substr(0,5)] <br/> [@ product] [=.code()] [=.name().substr(0,3).ucfirst()] [=.price()] <br/> [/] |
ABCDE 5 5 BCD a < b b > c I'm g 001 Vit $100.00 002 Sho $123.00 |
ABCDE 5 5 BCD a < b b > c I'm g 001 Vit $100.00 002 Sho $123.00 |
| 22. | [@ {'apple', 'banana', 'cherry'}] [=.i]: [=.v]: [=.h.isEven() ? "even" : "odd"] [?.h.isLast()]--Last[/]<br/> [/] |
0: apple:
odd 1: banana: even 2: cherry: odd --Last |
0: apple:
odd 1: banana: even 2: cherry: odd --Last |