YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,4 +1,3 @@
|
|||
USE: infix
|
||||
[infix
|
||||
5*(1+1) ! 10
|
||||
infix]
|
||||
MACRO: pre ( quot -- quot ) reverse ;
|
||||
|
||||
[ + 2 2 ] pre ! 4
|
||||
|
|
|
|||
1
Task/Inverted-syntax/Factor/inverted-syntax-3.factor
Normal file
1
Task/Inverted-syntax/Factor/inverted-syntax-3.factor
Normal file
|
|
@ -0,0 +1 @@
|
|||
[ + 3 + 2 2 ] pre ! 7
|
||||
3
Task/Inverted-syntax/Factor/inverted-syntax-4.factor
Normal file
3
Task/Inverted-syntax/Factor/inverted-syntax-4.factor
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
MACRO: pre ( quot -- quot ) 1 cut swap [ 0 ] dip reduce 1quotation ;
|
||||
|
||||
[ + 1 2 3 4 5 ] pre ! 15
|
||||
4
Task/Inverted-syntax/Factor/inverted-syntax-5.factor
Normal file
4
Task/Inverted-syntax/Factor/inverted-syntax-5.factor
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
USE: infix
|
||||
[infix
|
||||
5*(1+1) ! 10
|
||||
infix]
|
||||
30
Task/Inverted-syntax/Go/inverted-syntax.go
Normal file
30
Task/Inverted-syntax/Go/inverted-syntax.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type ibool bool
|
||||
|
||||
const itrue ibool = true
|
||||
|
||||
func (ib ibool) iif(cond bool) bool {
|
||||
if cond {
|
||||
return bool(ib)
|
||||
}
|
||||
return bool(!ib)
|
||||
}
|
||||
|
||||
func main() {
|
||||
var needUmbrella bool
|
||||
raining := true
|
||||
|
||||
// normal syntax
|
||||
if raining {
|
||||
needUmbrella = true
|
||||
}
|
||||
fmt.Printf("Is it raining? %t. Do I need an umbrella? %t\n", raining, needUmbrella)
|
||||
|
||||
// inverted syntax
|
||||
raining = false
|
||||
needUmbrella = itrue.iif(raining)
|
||||
fmt.Printf("Is it raining? %t. Do I need an umbrella? %t\n", raining, needUmbrella)
|
||||
}
|
||||
1
Task/Inverted-syntax/TI-83-BASIC/inverted-syntax.ti-83
Normal file
1
Task/Inverted-syntax/TI-83-BASIC/inverted-syntax.ti-83
Normal file
|
|
@ -0,0 +1 @@
|
|||
536→N
|
||||
Loading…
Add table
Add a link
Reference in a new issue