September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
10
Task/Metaprogramming/Racket/metaprogramming-1.rkt
Normal file
10
Task/Metaprogramming/Racket/metaprogramming-1.rkt
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#lang racket
|
||||
|
||||
(define-syntax-rule (list-when test body)
|
||||
(if test
|
||||
body
|
||||
'()))
|
||||
|
||||
(let ([not-a-string 42])
|
||||
(list-when (string? not-a-string)
|
||||
(string->list not-a-string)))
|
||||
8
Task/Metaprogramming/Racket/metaprogramming-2.rkt
Normal file
8
Task/Metaprogramming/Racket/metaprogramming-2.rkt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(require (for-syntax syntax/parse))
|
||||
|
||||
(define-syntax list-when
|
||||
(syntax-parser
|
||||
[(_ test:expr body:expr)
|
||||
#'(if test
|
||||
body
|
||||
null)]))
|
||||
Loading…
Add table
Add a link
Reference in a new issue