Christophe Weblog Wiki Code Publications Music
R implementation of the swank side of the (brand-new) slime-media contrib
[swankr.git] / swank-media.R
1 makeMediaReplResult <- function(value) {
2   UseMethod("makeMediaReplResult")
3 }
4
5 makeMediaReplResult.default <- function(value) {
6   makeReplResult(value)
7 }
8
9 makeMediaReplResult.trellis <- function(value) {
10   filename <- tempfile("swank-media-")
11   png(filename, width=320, height=200)
12   print(value)
13   dev.off()
14   list(quote(`:write-image`), list(list(quote(`:type`), quote(png),
15                                         quote(`:file`), filename)),
16        deparse(value$call, nlines=1))
17 }
18
19 makeReplResultFunction <- makeMediaReplResult