Permalink
Browse files

working on external file resources

  • Loading branch information...
1 parent 8f7400b commit 2d695d700a55df57a9ee60788f59d11f5cb12e12 Danny Yoo committed Aug 9, 2011
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,4 @@
+#lang planet dyoo/whalesong
+
+(require (planet dyoo/whalesong/resource))
+(file-resource "images/humpback.jpg")
View
@@ -72,6 +72,7 @@
let-values
let*-values
define-struct
+ struct
if
cond
else
View
@@ -1,5 +1,4 @@
#lang s-exp "lang/kernel.rkt"
-(provide (all-defined-out))
-
-(define-struct bytes-resource (name type bytes))
+(require "resource/main.rkt")
+(provide (all-from-out "resource/main.rkt"))
View
@@ -0,0 +1,22 @@
+#lang s-exp "../lang/kernel.rkt"
+
+(provide file-resource)
+
+
+(require "structs.rkt")
+
+;; Macros for recording the definition of resources in a program.
+(require (for-syntax racket/base))
+
+
+;; file-resource:
+;;
+(define-for-syntax (file-resource stx)
+ (syntax-case stx ()
+ [(_ path)
+ (syntax/loc stx
+ (let-syntax ([compile-time-code
+ (lambda (stx)
+ (displayln "at compile time")
+ #'(void))])
+ (resource path)))]))
View
@@ -0,0 +1,4 @@
+#lang s-exp "../lang/kernel.rkt"
+
+(require "compile-time.rkt")
+(provide (all-from-out "compile-time.rkt"))
View
@@ -0,0 +1,6 @@
+#lang s-exp "../lang/kernel.rkt"
+
+(provide (all-defined-out))
+
+
+(struct resource (path))

0 comments on commit 2d695d7

Please sign in to comment.