File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ This directory contains the implementations of PipeScript language keywords.
99
1010| DisplayName | Synopsis |
1111| ------------------------| -----------------------------------------------|
12+ | [ All] ( All.psx.ps1 ) | [ all keyword] ( All.psx.ps1 ) |
1213| [ Assert] ( Assert.psx.ps1 ) | [ Assert keyword] ( Assert.psx.ps1 ) |
1314| [ Await] ( Await.psx.ps1 ) | [ awaits asynchronous operations] ( Await.psx.ps1 ) |
1415| [ New] ( New.psx.ps1 ) | [ 'new' keyword] ( New.psx.ps1 ) |
@@ -18,6 +19,46 @@ This directory contains the implementations of PipeScript language keywords.
1819
1920# Examples
2021
22+ ## All Example 1
23+
24+
25+ ~~~ PowerShell
26+ & {
27+ $glitters = @{glitters=$true}
28+ all that glitters
29+ }.Transpile()
30+ ~~~
31+
32+ ## All Example 2
33+
34+
35+ ~~~ PowerShell
36+ function mallard([switch]$Quack) { $Quack }
37+ Get-Command mallard | Get-Member | Select-Object -ExpandProperty TypeName -Unique
38+ . {all functions that quack are ducks}.Transpile()
39+ Get-Command mallard | Get-Member | Select-Object -ExpandProperty TypeName -Unique
40+ ~~~
41+
42+ ## All Example 3
43+
44+
45+ ~~~ PowerShell
46+
47+ . {
48+ $numbers = 1..100
49+ $null = all $numbers where { ($_ % 2) -eq 1 } are odd
50+ $null = all $numbers where { ($_ % 2) -eq 0 } are even
51+ }.Transpile()
52+
53+ @(
54+ . { all even $numbers }.Transpile()
55+ ).Length
56+
57+ @(
58+ . { all odd $numbers }.Transpile()
59+ ).Length
60+ ~~~
61+
2162## Assert Example 1
2263
2364
You can’t perform that action at this time.
0 commit comments