@@ -33,11 +33,19 @@ title: "Standard Library"
33
33
Sorts the students by GPA
34
34
~~~
35
35
search
36
- [#student GPA]
36
+ [#student name GPA]
37
37
index = gather/sort[for: GPA]
38
38
bind
39
39
[#ui/text sort: index, text: "{{name}} {{GPA}}"]
40
40
~~~
41
+
42
+ Add some students
43
+ ~~~
44
+ commit
45
+ [#student name: "Ashley" GPA: 3.10]
46
+ [#student name: "Jerome" GPA: 2.37]
47
+ [#student name: "Iggy" GPA: 3.97]
48
+ ~~~
41
49
</code>
42
50
</td>
43
51
</tr >
@@ -66,6 +74,14 @@ search
66
74
bind
67
75
[#ui/text text: "{{population}} people live in {{state}}"]
68
76
~~~
77
+
78
+ Add some citizens
79
+ ~~~
80
+ commit
81
+ [#citizen name: "Regina" state: "CA"]
82
+ [#citizen name: "Travis" state: "WA"]
83
+ [#citizen name: "Sally" state: "CA"]
84
+ ~~~
69
85
</code>
70
86
</td>
71
87
</tr >
@@ -96,6 +112,14 @@ search
96
112
bind
97
113
[#ui/text text: "{{department}} - ${{payroll}}.00"]
98
114
~~~
115
+
116
+ Add some employees
117
+ ~~~
118
+ commit
119
+ [#employee name:"Cooper" salary:2 department:"engineering"]
120
+ [#employee name:"Adrienne" salary:5 department:"engineering"]
121
+ [#employee name:"Najib" salary:10 department:"marketing"]
122
+ ~~~
99
123
</code>
100
124
</td>
101
125
</tr >
@@ -395,9 +419,17 @@ bind
395
419
</td>
396
420
<td>
397
421
<code>
398
- pi represented as the string "3.14"
399
- [#circle circumference diameter]
400
- pi = math/to-fixed[a: (circumference / diameter), b: 2]</code>
422
+ pi represented as the string "3.14"
423
+ ~~~
424
+ search
425
+ circumference = 6
426
+ diameter = 1.910
427
+ pi = math/to-fixed[a: (circumference / diameter), b: 2]
428
+
429
+ bind
430
+ [#ui/text text: pi]
431
+ ~~~
432
+ </code>
401
433
</td>
402
434
</tr >
403
435
</table >
@@ -417,8 +449,15 @@ bind
417
449
</ul>
418
450
</td>
419
451
<td>
420
- <code> generates integers 1 through 10
421
- y = math/range[start: 1, stop: 10]</code>
452
+ <code>
453
+ generates integers 1 through 10
454
+ ~~~
455
+ search
456
+ y = math/range[start: 1, stop: 10]
457
+ bind
458
+ [#ui/text text: y]
459
+ ~~~
460
+ </code >
422
461
</td>
423
462
</tr >
424
463
</table >
@@ -437,9 +476,22 @@ bind
437
476
</ul>
438
477
</td>
439
478
<td>
440
- <code> generates a random number every second
441
- [#time minutes seconds]
442
- x = random/number[seed: seconds]</code>
479
+ <code>
480
+ generates a random number every second
481
+ ~~~
482
+ search
483
+ [#time second]
484
+ x = random/number[seed: second]
485
+ bind
486
+ [#ui/text text: x]
487
+ ~~~
488
+
489
+ Start a timer
490
+ ~~~
491
+ commit
492
+ [#system/timer #time resolution: 1000]
493
+ ~~~
494
+ </code>
443
495
</td>
444
496
</tr >
445
497
</table >
@@ -462,9 +514,17 @@ bind
462
514
</ul>
463
515
</td>
464
516
<td>
465
- <code> Americanized version of British spelling
517
+ <code>
466
518
[#website body]
467
- american-version = string/replace[text: body, replace: "flavour", with: "flavor"]</code>
519
+ </code>
520
+ Americanized version of British spelling
521
+ ~~~
522
+ search
523
+ string = "I love the flavour."
524
+ american-version = string/replace[text: string, replace: "flavour", with: "flavor"]
525
+ bind
526
+ [#ui/text text: american-version]
527
+ ~~~
468
528
</td>
469
529
</tr >
470
530
</table >
@@ -484,17 +544,24 @@ bind
484
544
</ul>
485
545
</td>
486
546
<td>
487
- <code> finds the 17th letter of the alphabet
488
- alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
489
- letter = string/get[text: alphabet, at: 17]</code>
547
+ <code>
548
+ finds the 17th letter of the alphabet
549
+ ~~~
550
+ search
551
+ alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
552
+ letter = string/get[text: alphabet, at: 17]
553
+ bind
554
+ [#ui/text text: "The 17th letter of the alphabet is {{letter}}"]
555
+ ~~~
556
+ </code >
490
557
</td>
491
558
</tr >
492
559
</table >
493
560
494
561
<table class =" libitem " >
495
562
<tr >
496
563
<td colspan="2">
497
- <b>string/uppercase</b> -Converts a string to uppercase
564
+ <b>string/uppercase</b> - Converts a string to uppercase
498
565
</td>
499
566
</tr >
500
567
@@ -505,8 +572,15 @@ bind
505
572
</ul>
506
573
</td>
507
574
<td>
508
- <code>funny = "lol"
509
- really-funny = string/uppercase[text: funny]</code>
575
+ <code>
576
+ ~~~
577
+ search
578
+ funny = "lol"
579
+ really-funny = string/uppercase[text: funny]
580
+ bind
581
+ [#ui/text text: really-funny]
582
+ ~~~
583
+ </code >
510
584
</td>
511
585
</tr >
512
586
</table >
@@ -525,8 +599,15 @@ bind
525
599
</ul>
526
600
</td>
527
601
<td>
528
- <code>really-funny = "LOL"
529
- down-a-notch = string/uppercase[text: really-funny]</code>
602
+ <code>
603
+ ~~~
604
+ search
605
+ really-funny = "LOL"
606
+ down-a-notch = string/lowercase[text: really-funny]
607
+ bind
608
+ [#ui/text text: down-a-notch]
609
+ ~~~
610
+ </code >
530
611
</td>
531
612
</tr >
532
613
</table >
@@ -546,8 +627,15 @@ bind
546
627
</ul>
547
628
</td>
548
629
<td>
549
- <code> Eve is in developers, starting at an index of 2
550
- index = string/index-of[text: "developers", substring: "eve"</code>
630
+ <code>
631
+ "eve" is in "developers" at index 2.
632
+ ~~~
633
+ search
634
+ index = string/index-of[text: "developers", substring: "eve"]
635
+ bind
636
+ [#ui/text: "String found at index {{index}}"]
637
+ ~~~
638
+ </code >
551
639
</td>
552
640
</tr >
553
641
</table >
@@ -566,9 +654,16 @@ bind
566
654
</ul>
567
655
</td>
568
656
<td>
569
- <code> the code point length of the word "unicode"
570
- string = "unicode"
571
- length-in-js = string/codepoint-length[text: string]</code>
657
+ <code>
658
+ the code point length of the word "unicode"
659
+ ~~~
660
+ search
661
+ string = "unicode"
662
+ length-in-js = string/codepoint-length[text: string]
663
+ bind
664
+ [#ui/text text: length-in-js]
665
+ ~~~
666
+ </code >
572
667
</td>
573
668
</tr >
574
669
</table >
@@ -1341,7 +1436,12 @@ commit
1341
1436
<li>Other attributes - (optional) - other attribute-value pairs will be applied directly to the button for integration with existing JS libraries or debugging</li>
1342
1437
</ul>
1343
1438
</td>
1344
- <td><code></code>
1439
+ <td><code>
1440
+ ~~~
1441
+ commit
1442
+ [ #ui/button class: "flat" icon: "search" text: "Search"]
1443
+ ~~~
1444
+ </code>
1345
1445
</td>
1346
1446
</tr>
1347
1447
</table>
0 commit comments