| PasteRack.org | ||
| Paste # 38830 | ||
| 2016-02-08 22:18:17 | ||
Fork as a new paste. | ||
Paste viewed 87 times. | ||
Tweet | ||
Embed: | ||
#lang racket
(define-syntax-rule (M <num-rows> × <num-columns> (<x-tag> <y-tag>) <f>)
(λ args
(define (element-at arg1 arg2)
(match <f>
[(,func ,params ...) (apply func (map element-at params))]
[<x-tag> arg1]
[<y-tag> arg2]
[x x]))
(match args
[`(,arg1 ,arg2) (element arg1 arg2)]
[`(rows) <num-rows>]
[`(columns) <num-columns>]
)))