Compare commits
No commits in common. "master" and "triangle" have entirely different histories.
|
@ -45,8 +45,8 @@ cs019-doc:
|
|||
|
||||
setup:
|
||||
|
||||
raco setup --no-docs -P dyoo whalesong.plt 1 19
|
||||
raco setup --no-docs -P dyoo whalesong.plt 1 16
|
||||
|
||||
|
||||
planet-link:
|
||||
raco planet link dyoo whalesong.plt 1 19 .
|
||||
raco planet link dyoo whalesong.plt 1 16 .
|
|
@ -1,7 +1,7 @@
|
|||
======================================================================
|
||||
Whalesong: a compiler from Racket to JavaScript.
|
||||
|
||||
Danny Yoo (dyoo@hashcollision.org)
|
||||
Danny Yoo (dyoo@cs.wpi.edu)
|
||||
|
||||
|
||||
======================================================================
|
||||
|
@ -29,30 +29,21 @@ amount of time.
|
|||
Example usage
|
||||
|
||||
|
||||
Create a simple, executable of your program. At the moment, the program must
|
||||
be written in the base language of whalesong. (This restriction currently
|
||||
prevents arbitrary racket/base programs from compiling, and we'll be working to
|
||||
remove this restriction.)
|
||||
|
||||
Create a simple, standalong executable of your program. At the
|
||||
moment, the program must be written in the base language of whalesong.
|
||||
(This restriction currently prevents arbitrary racket/base programs
|
||||
from compiling, and we'll be working to remove this restriction.)
|
||||
|
||||
$ cat hello.rkt
|
||||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
(display "hello world")
|
||||
(newline)
|
||||
|
||||
$ ./whalesong.rkt build hello.rkt
|
||||
|
||||
$ ls -l hello.html
|
||||
-rw-rw-r-- 1 dyoo nogroup 692213 Jun 7 18:00 hello.html
|
||||
|
||||
To build standalone executable of your program, provide --as-standalone-html
|
||||
flag.
|
||||
|
||||
$ ./whalesong.rkt build --as-standalone-html hello.rkt
|
||||
|
||||
$ ls -l
|
||||
-rw-rw-r-- 1 dyoo nogroup 692213 Jun 7 18:00 hello.html
|
||||
|
||||
NOTE: Earlier versions had --as-standalone-xhtml flag, which is now removed.
|
||||
$ ls -l hello.xhtml
|
||||
-rw-rw-r-- 1 dyoo nogroup 692213 Jun 7 18:00 hello.xhtml
|
||||
|
||||
|
||||
[FIXME: add more examples]
|
||||
|
@ -196,4 +187,4 @@ This uses code from the following projects:
|
|||
jquery (http://jquery.com/)
|
||||
|
||||
|
||||
[FIXME: add more]
|
||||
[FIXME: add more]
|
46
README.md
46
README.md
|
@ -1,46 +0,0 @@
|
|||
Whalesong
|
||||
=========
|
||||
|
||||
Important
|
||||
---------
|
||||
|
||||
Whalesong needs Racket 6.2.
|
||||
As is Whalesong doesn't work on version 6.3 or greater.
|
||||
See https://github.com/soegaard/whalesong/issues/48
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
raco pkg install -j 1 --force --deps search-auto --scope installation whalesong
|
||||
|
||||
Important: Use -j 1 to build Whalesong (this turns off parallel builds)
|
||||
This also means, that you can't install Whalesong from the DrRacket package manager.
|
||||
|
||||
This fork of Whalesong differs from dyoo/whalesong in the following ways:
|
||||
|
||||
* Builds on latest release of Racket
|
||||
(fixes the x undefined problem)
|
||||
* Adds for
|
||||
(require whalesong/lang/for)
|
||||
* Adds match
|
||||
(require whalesong/lang/match)
|
||||
* Adds on-release
|
||||
(as a complement to on-key)
|
||||
Contributed by Darren Cruse
|
||||
* Adds parameters
|
||||
(require whalesong/lang/parameters)
|
||||
* Extended whalesong/image and whalesong/images
|
||||
(more functions, bug fixes, now matches WeScheme)
|
||||
Contributed by Emmanuel Schanzer
|
||||
* Adds play-sound
|
||||
(assumes a browser with html5 audio support)
|
||||
Contributed by Emmanuel Schanzer and Darren Cruse
|
||||
* Bug fixes by Vishesh Yadav
|
||||
* The flag --as-standalone-xhtml is now --as-standalone-html
|
||||
and produces standalone html rather than xhtml.
|
||||
|
||||
Note: The implementation of parameters works fine,
|
||||
as long as you don't mix parameterize with non-local-exits
|
||||
and reentries (i.e. call/cc and friends)
|
||||
|
||||
/soegaard
|
|
@ -1,9 +1,11 @@
|
|||
#lang s-exp syntax/module-reader
|
||||
#:language (lambda () 'whalesong/bf/language)
|
||||
#:language (lambda ()
|
||||
`(planet ,(this-package-version-symbol bf/language)))
|
||||
#:read my-read
|
||||
#:read-syntax my-read-syntax
|
||||
#:info my-get-info
|
||||
(require "../parser.rkt")
|
||||
(require "../parser.rkt"
|
||||
planet/version)
|
||||
|
||||
(define (my-read in)
|
||||
(syntax->datum (my-read-syntax #f in)))
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require "semantics.rkt"
|
||||
(for-syntax racket/base))
|
||||
|
@ -100,4 +100,4 @@
|
|||
(with-syntax ([current-data (datum->syntax stx 'current-data)]
|
||||
[current-ptr (datum->syntax stx 'current-ptr)])
|
||||
(syntax/loc stx
|
||||
(loop current-data current-ptr body ...)))]))
|
||||
(loop current-data current-ptr body ...)))]))
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
;; This is a second semantics for the language that tries to go for speed,
|
||||
;; at the expense of making things a little more complicated.
|
|
@ -14,7 +14,7 @@
|
|||
(require/typed "../parameters.rkt"
|
||||
(current-defined-name (Parameterof (U Symbol LamPositionalName))))
|
||||
(require/typed "../parser/parse-bytecode.rkt"
|
||||
(parse-bytecode (Compiled-Expression -> Expression)))
|
||||
(parse-bytecode (Any -> Expression)))
|
||||
|
||||
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
#lang typed/racket/base
|
||||
(require "expression-structs.rkt"
|
||||
"analyzer-structs.rkt")
|
||||
|
||||
|
||||
(provide (all-defined-out))
|
||||
|
@ -40,8 +38,3 @@
|
|||
(define-type Linkage (U NextLinkage
|
||||
LabelLinkage
|
||||
ReturnLinkage))
|
||||
|
||||
|
||||
;; Lambda and compile-time environment
|
||||
(define-struct: lam+cenv ([lam : (U Lam CaseLam)]
|
||||
[cenv : CompileTimeEnvironment]))
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong (require "../selfhost-lang.rkt")
|
||||
#lang typed/racket/base
|
||||
(require "lexical-structs.rkt")
|
||||
|
||||
|
|
@ -45,8 +45,7 @@
|
|||
(define-type Target (U AtomicRegisterSymbol
|
||||
EnvLexicalReference
|
||||
EnvPrefixReference
|
||||
PrimitivesReference
|
||||
GlobalsReference
|
||||
PrimitivesReference
|
||||
ControlFrameTemporary
|
||||
ModulePrefixTarget
|
||||
))
|
||||
|
@ -153,10 +152,6 @@
|
|||
(define-struct: PrimitivesReference ([name : Symbol])
|
||||
#:transparent)
|
||||
|
||||
(define-struct: GlobalsReference ([name : Symbol])
|
||||
#:transparent)
|
||||
|
||||
|
||||
;; Produces the entry point of the module.
|
||||
(define-struct: ModuleEntry ([name : ModuleLocator])
|
||||
#:transparent)
|
||||
|
@ -172,7 +167,6 @@
|
|||
(define-type StraightLineStatement (U
|
||||
DebugPrint
|
||||
Comment
|
||||
MarkEntryPoint
|
||||
|
||||
AssignImmediate
|
||||
AssignPrimOp
|
||||
|
@ -212,18 +206,6 @@
|
|||
#:transparent)
|
||||
|
||||
|
||||
;; Returns a pair of labels, the first being the mutiple-value-return
|
||||
;; label and the second its complementary single-value-return label.
|
||||
(: new-linked-labels (Symbol -> (Values Symbol LinkedLabel)))
|
||||
(define (new-linked-labels sym)
|
||||
(define a-label-multiple (make-label (string->symbol (format "~aMultiple" sym))))
|
||||
(define a-label (make-LinkedLabel (make-label sym) a-label-multiple))
|
||||
(values a-label-multiple a-label))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; FIXME: it would be nice if I can reduce AssignImmediate and
|
||||
;; AssignPrimOp into a single Assign statement, but I run into major
|
||||
;; issues with Typed Racket taking minutes to compile. So we're
|
||||
|
@ -265,12 +247,12 @@
|
|||
(define-struct: PushControlFrame/Call ([label : LinkedLabel])
|
||||
#:transparent)
|
||||
|
||||
(define-struct: PushControlFrame/Prompt
|
||||
([tag : (U OpArg DefaultContinuationPromptTag)]
|
||||
[label : LinkedLabel])
|
||||
(define-struct: PushControlFrame/Prompt ([tag : (U OpArg DefaultContinuationPromptTag)]
|
||||
[label : LinkedLabel]
|
||||
;; TODO: add handler and arguments
|
||||
)
|
||||
#:transparent)
|
||||
|
||||
|
||||
(define-struct: DefaultContinuationPromptTag ()
|
||||
#:transparent)
|
||||
(define default-continuation-prompt-tag
|
||||
|
@ -299,11 +281,6 @@
|
|||
#:transparent)
|
||||
|
||||
|
||||
;; Marks the head of every lambda.
|
||||
(define-struct: MarkEntryPoint ([label : Symbol])
|
||||
#:transparent)
|
||||
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Primitive Operators
|
||||
|
@ -318,7 +295,6 @@
|
|||
|
||||
ModuleVariable
|
||||
PrimitivesReference
|
||||
GlobalsReference
|
||||
|
||||
MakeBoxedEnvironmentValue
|
||||
|
||||
|
@ -404,12 +380,6 @@
|
|||
[pos : Natural])
|
||||
#:transparent)
|
||||
|
||||
;; Check that the global can be defined.
|
||||
;; If not, raise an error and stop evaluation.
|
||||
(define-struct: CheckGlobalBound! ([name : Symbol])
|
||||
#:transparent)
|
||||
|
||||
|
||||
;; Check the closure procedure value in 'proc and make sure it's a closure
|
||||
;; that can accept the right arguments (stored as a number in the argcount register.).
|
||||
(define-struct: CheckClosureAndArity! ()
|
||||
|
@ -491,12 +461,6 @@
|
|||
(define-struct: InstallContinuationMarkEntry! () #:transparent)
|
||||
|
||||
|
||||
;; Use the dynamic module loader to link the module into the runtime.
|
||||
;; After successful linkage, jump into label.
|
||||
(define-struct: LinkModule! ([path : ModuleLocator]
|
||||
[label : Symbol]))
|
||||
|
||||
|
||||
;; Installs a module record into the machine
|
||||
(define-struct: InstallModuleEntry! ([name : Symbol]
|
||||
[path : ModuleLocator]
|
||||
|
@ -516,15 +480,13 @@
|
|||
|
||||
;; Given the module locator, do any finalizing operations, like
|
||||
;; setting up the module namespace.
|
||||
(define-struct: FinalizeModuleInvokation! ([path : ModuleLocator]
|
||||
[provides : (Listof ModuleProvide)])
|
||||
(define-struct: FinalizeModuleInvokation! ([path : ModuleLocator])
|
||||
#:transparent)
|
||||
|
||||
|
||||
|
||||
(define-type PrimitiveCommand (U
|
||||
CheckToplevelBound!
|
||||
CheckGlobalBound!
|
||||
CheckClosureAndArity!
|
||||
CheckPrimitiveArity!
|
||||
|
||||
|
@ -546,7 +508,6 @@
|
|||
RestoreEnvironment!
|
||||
RestoreControl!
|
||||
|
||||
LinkModule!
|
||||
InstallModuleEntry!
|
||||
MarkModuleInvoked!
|
||||
AliasModuleAsMain!
|
||||
|
@ -620,4 +581,4 @@
|
|||
|
||||
|
||||
|
||||
(define-predicate OpArg? OpArg)
|
||||
(define-predicate OpArg? OpArg)
|
|
@ -19,12 +19,7 @@
|
|||
(or (and (eq? (ModuleLocator-name locator) '#%kernel)
|
||||
(eq? (ModuleLocator-real-path locator) '#%kernel))
|
||||
(eq? (ModuleLocator-name locator)
|
||||
'whalesong/lang/kernel.rkt)
|
||||
|
||||
;; HACK HACK HACK
|
||||
;; This is for srcloc:
|
||||
(eq? (ModuleLocator-name locator)
|
||||
'collects/racket/private/kernstruct.rkt)))
|
||||
'whalesong/lang/kernel.rkt)))
|
||||
|
||||
|
||||
(: paramz-locator? (ModuleLocator -> Boolean))
|
||||
|
@ -177,22 +172,8 @@
|
|||
|
||||
'error
|
||||
'raise-type-error
|
||||
'raise-mismatch-error
|
||||
'struct:exn:fail
|
||||
'prop:exn:srclocs
|
||||
'make-exn
|
||||
'make-exn:fail
|
||||
'make-exn:fail:contract
|
||||
'make-exn:fail:contract:arity
|
||||
'make-exn:fail:contract:variable
|
||||
'make-exn:fail:contract:divide-by-zero
|
||||
|
||||
'exn:fail?
|
||||
'exn:fail:contract?
|
||||
'exn:fail:contract:arity?
|
||||
|
||||
'exn-message
|
||||
'exn-continuation-marks
|
||||
|
||||
'hash?
|
||||
'hash-equal?
|
||||
|
@ -223,10 +204,6 @@
|
|||
|
||||
'unsafe-car
|
||||
'unsafe-cdr
|
||||
|
||||
'continuation-prompt-available?
|
||||
'abort-current-continuation
|
||||
'call-with-continuation-prompt
|
||||
))
|
||||
(define-predicate KernelPrimitiveName? KernelPrimitiveName)
|
||||
|
||||
|
@ -372,4 +349,4 @@
|
|||
(list 'vector 'number)]
|
||||
|
||||
[(eq? prim 'vector-set!)
|
||||
(list 'vector 'number 'any)]))
|
||||
(list 'vector 'number 'any)]))
|
|
@ -122,8 +122,8 @@
|
|||
;; Given a list of lexical addresses, computes a set of unique references.
|
||||
;; Multiple lexical addresses to a single prefix should be treated identically.
|
||||
(define (collect-lexical-references addresses)
|
||||
(let: ([prefix-references : (Setof EnvWholePrefixReference) ((inst new-set EnvWholePrefixReference))]
|
||||
[lexical-references : (Setof EnvLexicalReference) ((inst new-set EnvLexicalReference))])
|
||||
(let: ([prefix-references : (Setof EnvWholePrefixReference) (new-set)]
|
||||
[lexical-references : (Setof EnvLexicalReference) (new-set)])
|
||||
(let: loop : (Listof (U EnvLexicalReference EnvWholePrefixReference))
|
||||
([addresses : (Listof LexicalAddress) addresses])
|
||||
(cond
|
|
@ -147,9 +147,7 @@
|
|||
|
||||
[(PrimitivesReference? op)
|
||||
op]
|
||||
|
||||
[(GlobalsReference? op)
|
||||
op]))
|
||||
))
|
||||
|
||||
|
||||
(: rewrite-primcmd (PrimitiveCommand -> PrimitiveCommand))
|
||||
|
@ -190,17 +188,14 @@
|
|||
(loop (rest stmts)))]
|
||||
|
||||
[(DebugPrint? a-stmt)
|
||||
(cons a-stmt (loop (rest stmts)))
|
||||
#;(loop (rest stmts))
|
||||
;(cons a-stmt (loop (rest stmts)))
|
||||
(loop (rest stmts))
|
||||
]
|
||||
|
||||
[(Comment? a-stmt)
|
||||
;(loop (rest stmts))
|
||||
(cons a-stmt (loop (rest stmts)))
|
||||
]
|
||||
|
||||
[(MarkEntryPoint? a-stmt)
|
||||
(cons a-stmt (loop (rest stmts)))]
|
||||
|
||||
[(AssignImmediate? a-stmt)
|
||||
(cons (make-AssignImmediate (rewrite-target (AssignImmediate-target a-stmt))
|
||||
|
@ -349,11 +344,8 @@
|
|||
#f]
|
||||
|
||||
[(DebugPrint? stmt)
|
||||
#f
|
||||
#;#t]
|
||||
|
||||
[(MarkEntryPoint? stmt)
|
||||
#f]
|
||||
;#f
|
||||
#t]
|
||||
|
||||
[(AssignImmediate? stmt)
|
||||
(equal? (AssignImmediate-target stmt)
|
||||
|
@ -450,4 +442,4 @@
|
|||
(define (ensure-natural x)
|
||||
(if (natural? x)
|
||||
x
|
||||
(error 'ensure-natural)))
|
||||
(error 'ensure-natural)))
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong/base
|
||||
#lang planet dyoo/whalesong/base
|
||||
#|
|
||||
Why on earth are these here?
|
||||
Because first, etc. don't work on cyclic lists:
|
|
@ -3,29 +3,11 @@
|
|||
(require (for-template "../lang/base.rkt")
|
||||
(for-template "teach-runtime.rkt")
|
||||
"teachhelp.rkt"
|
||||
stepper/private/shared
|
||||
racket/list
|
||||
syntax/context
|
||||
syntax/kerncase
|
||||
syntax/stx
|
||||
"../version-case/version-case.rkt"
|
||||
(for-syntax racket/base))
|
||||
|
||||
;; We're treading in private implementation; we deserve this pain.
|
||||
(version-case
|
||||
[(and (version<= "5.2.0.900" (version))
|
||||
(version< (version) "5.2.900"))
|
||||
(begin
|
||||
(require stepper/private/shared)
|
||||
(require (for-syntax stepper/private/shared)))]
|
||||
[(version<= "5.2.900" (version))
|
||||
(begin
|
||||
(require stepper/private/syntax-property)
|
||||
(require (for-syntax stepper/private/syntax-property)))]
|
||||
[else
|
||||
(error 'teachhelp.rkt "Unable to cooperate with Racket ~a" (version))])
|
||||
|
||||
|
||||
|
||||
syntax/stx)
|
||||
|
||||
|
||||
(provide advanced-define/proc
|
|
@ -1,23 +1,10 @@
|
|||
(module teachhelp mzscheme
|
||||
(require "firstorder.rkt"
|
||||
"rewrite-error-message.rkt"
|
||||
"../version-case/version-case.rkt")
|
||||
stepper/private/shared)
|
||||
|
||||
;; We're treading in private implementation; we deserve this pain.
|
||||
(version-case
|
||||
[(and (version<= "5.2.0.900" (version))
|
||||
(version< (version) "5.2.900"))
|
||||
(begin
|
||||
(require stepper/private/shared)
|
||||
(require-for-syntax stepper/private/shared))]
|
||||
[(version<= "5.2.900" (version))
|
||||
(begin
|
||||
(require stepper/private/syntax-property)
|
||||
(require-for-syntax stepper/private/syntax-property))]
|
||||
[else
|
||||
(error 'teachhelp.rkt "Unable to cooperate with Racket ~a" (version))])
|
||||
(require-for-syntax stepper/private/shared)
|
||||
|
||||
|
||||
(provide make-undefined-check
|
||||
make-first-order-function)
|
||||
|
3
examples/alert.rkt
Normal file
3
examples/alert.rkt
Normal file
|
@ -0,0 +1,3 @@
|
|||
#lang planet dyoo/whalesong
|
||||
(require (planet dyoo/whalesong/js))
|
||||
(alert "hello world")
|
2
examples/cs019/hello.rkt
Normal file
2
examples/cs019/hello.rkt
Normal file
|
@ -0,0 +1,2 @@
|
|||
#lang planet dyoo/whalesong/cs019
|
||||
"hello world"
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong/cs019
|
||||
#lang planet dyoo/whalesong/cs019
|
||||
|
||||
(define-resource index.html)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong/cs019
|
||||
#lang planet dyoo/whalesong/cs019
|
||||
|
||||
(define-resource index.html)
|
||||
|
||||
|
@ -53,4 +53,4 @@
|
|||
(initial-view index.html)
|
||||
(to-draw draw)
|
||||
(on-location-change location-change)
|
||||
(on-mock-location-change mock-location-change))
|
||||
(on-mock-location-change mock-location-change))
|
|
@ -1,6 +1,6 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/js)
|
||||
(require (planet dyoo/whalesong/js))
|
||||
|
||||
|
||||
;; insert-break: -> void
|
||||
|
@ -34,4 +34,4 @@
|
|||
(write-message "viewport-width: ") (write-message (viewport-width))
|
||||
(insert-break)
|
||||
(write-message "viewport-height: ") (write-message (viewport-height))
|
||||
(insert-break)
|
||||
(insert-break)
|
|
@ -1,10 +1,10 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
;; Eli's puzzle
|
||||
;;
|
||||
;; http://lists.racket-lang.org/users/archive/2011-July/046849.html
|
||||
|
||||
(require whalesong/world)
|
||||
(require (planet dyoo/whalesong/world))
|
||||
|
||||
(define-struct world (seq output))
|
||||
|
||||
|
@ -42,4 +42,4 @@
|
|||
|
||||
(big-bang (make-world '(1) '())
|
||||
(on-tick tick 1)
|
||||
(to-draw draw))
|
||||
(to-draw draw))
|
|
@ -1,7 +1,7 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/world
|
||||
whalesong/image)
|
||||
(require (planet dyoo/whalesong/world)
|
||||
(planet dyoo/whalesong/image))
|
||||
|
||||
|
||||
(define handler (on-tick add1 1))
|
||||
|
@ -21,4 +21,4 @@ handler
|
|||
)
|
||||
|
||||
|
||||
"all done"
|
||||
"all done"
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
(provide fact)
|
||||
(define (fact x)
|
||||
(cond
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong/bf
|
||||
#lang planet dyoo/whalesong/bf
|
||||
|
||||
+++++ +++++ initialize counter (cell #0) to 10
|
||||
[ use loop to set the next four cells to 70/100/30/10
|
|
@ -1,6 +1,6 @@
|
|||
#lang whalesong/base
|
||||
(require whalesong/web-world
|
||||
whalesong/resource)
|
||||
#lang planet dyoo/whalesong/base
|
||||
(require (planet dyoo/whalesong/web-world)
|
||||
(planet dyoo/whalesong/resource))
|
||||
|
||||
(define-resource hello-css.css)
|
||||
(define-resource hello-css-main.html)
|
||||
|
@ -9,4 +9,4 @@
|
|||
(initial-view hello-css-main.html)
|
||||
(to-draw (lambda (w v) v)))
|
||||
|
||||
"done"
|
||||
"done"
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong/korean
|
||||
#lang planet dyoo/whalesong/korean
|
||||
|
||||
|
||||
(정의 (안녕 이름)
|
||||
|
@ -19,4 +19,4 @@
|
|||
|
||||
|
||||
(정의-구조 사람 (이름 나이))
|
||||
(make-사람 "danny" 32)
|
||||
(make-사람 "danny" 32)
|
4
examples/hello.rkt
Normal file
4
examples/hello.rkt
Normal file
|
@ -0,0 +1,4 @@
|
|||
#lang planet dyoo/whalesong
|
||||
|
||||
(display "hello world")
|
||||
(newline)
|
|
@ -1,6 +1,6 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/image)
|
||||
(require (planet dyoo/whalesong/image))
|
||||
|
||||
(printf "images.rkt\n")
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 569 KiB After Width: | Height: | Size: 569 KiB |
|
@ -1,6 +1,6 @@
|
|||
#lang whalesong/base
|
||||
(require whalesong/resource
|
||||
whalesong/image)
|
||||
#lang planet dyoo/whalesong/base
|
||||
(require (planet dyoo/whalesong/resource)
|
||||
(planet dyoo/whalesong/image))
|
||||
|
||||
;; The Iron Image Puzzle
|
||||
;; Part of the Nifty Assignments page by Nick Parlante.
|
||||
|
@ -9,7 +9,7 @@
|
|||
;; To run this program locally on your machine under Google Chrome, you'll
|
||||
;; probably need to use --allow-file-access-from-files to get around
|
||||
;; the same-origin policy. The program should run normally if served on
|
||||
;; a web server.
|
||||
;; a web server
|
||||
|
||||
(define-resource iron-puzzle.png)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(define (mylen x acc)
|
||||
(cond
|
||||
|
@ -10,4 +10,4 @@
|
|||
(define v (build-list 1000000 (lambda (i) i)))
|
||||
(printf "Built list\n")
|
||||
(mylen v 0)
|
||||
"done computing length"
|
||||
"done computing length"
|
|
@ -1,6 +1,6 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/image)
|
||||
(require (planet dyoo/whalesong/image))
|
||||
|
||||
|
||||
(define lst
|
|
@ -1,5 +1,5 @@
|
|||
#lang whalesong
|
||||
(require whalesong/web-world)
|
||||
#lang planet dyoo/whalesong
|
||||
(require (planet dyoo/whalesong/web-world))
|
||||
|
||||
;;; This demonstrates how to use MathJax to write equations.
|
||||
;;; Use --include-script mathjax-script.js to include the MathJax.
|
||||
|
@ -19,4 +19,4 @@
|
|||
(big-bang 3
|
||||
(initial-view (xexp->dom '(html (head) (body))))
|
||||
(on-tick tick 5)
|
||||
(to-draw draw))
|
||||
(to-draw draw))
|
|
@ -1,7 +1,7 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/world
|
||||
whalesong/image)
|
||||
(require (planet dyoo/whalesong/world)
|
||||
(planet dyoo/whalesong/image))
|
||||
|
||||
(define width 640)
|
||||
(define height 480)
|
||||
|
@ -26,4 +26,4 @@
|
|||
(printf "let's see how this works.\n\n")
|
||||
(big-bang (make-posn 0 0)
|
||||
(on-mouse mouse)
|
||||
(to-draw draw))
|
||||
(to-draw draw))
|
|
@ -1,7 +1,8 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/world
|
||||
whalesong/image)
|
||||
(require (planet dyoo/whalesong/world)
|
||||
(planet dyoo/whalesong/image)
|
||||
)
|
||||
|
||||
|
||||
;; Constants:
|
|
@ -1,8 +1,8 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/world
|
||||
whalesong/image
|
||||
whalesong/js)
|
||||
(require (planet dyoo/whalesong/world)
|
||||
(planet dyoo/whalesong/image)
|
||||
(planet dyoo/whalesong/js))
|
||||
|
||||
;; Occupy the whole screen.
|
||||
(void (call-method body "css" "margin" 0))
|
||||
|
@ -128,4 +128,4 @@
|
|||
|
||||
(big-bang (make-world '())
|
||||
(to-draw draw)
|
||||
(on-tick tick))
|
||||
(on-tick tick))
|
|
@ -1,7 +1,7 @@
|
|||
#lang whalesong
|
||||
(require whalesong/resource
|
||||
whalesong/web-world
|
||||
whalesong/js)
|
||||
#lang planet dyoo/whalesong
|
||||
(require (planet dyoo/whalesong/resource)
|
||||
(planet dyoo/whalesong/web-world)
|
||||
(planet dyoo/whalesong/js))
|
||||
|
||||
; This is a small demonstration of the Javascript
|
||||
; graphics library Raphael from http://raphaeljs.com/ .
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(let loop ([b (read-byte)])
|
||||
(cond
|
||||
|
@ -6,4 +6,4 @@
|
|||
(void)]
|
||||
[else
|
||||
(display (string (integer->char b)))
|
||||
(loop (read-byte))]))
|
||||
(loop (read-byte))]))
|
|
@ -1,4 +1,4 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
|
||||
;; shuffle: vector -> vector
|
|
@ -1,5 +1,5 @@
|
|||
#lang whalesong/base
|
||||
(require whalesong/image)
|
||||
#lang planet dyoo/whalesong/base
|
||||
(require (planet dyoo/whalesong/image))
|
||||
;; Sierpenski carpet.
|
||||
;; http://rosettacode.org/wiki/Sierpinski_carpet#Scheme
|
||||
|
||||
|
@ -36,4 +36,4 @@
|
|||
(apply above (outer 0)))))
|
||||
|
||||
|
||||
(carpet 4)
|
||||
(carpet 4)
|
599
examples/snip.rkt
Normal file
599
examples/snip.rkt
Normal file
|
@ -0,0 +1,599 @@
|
|||
#reader(lib"read.ss""wxme")WXME0108 ##
|
||||
#|
|
||||
This file uses the GRacket editor format.
|
||||
Open this file in DrRacket version 5.1.2 or later to read it.
|
||||
|
||||
Most likely, it was created by saving a program in DrRacket,
|
||||
and it probably contains a program with non-text elements
|
||||
(such as images or comment boxes).
|
||||
|
||||
http://racket-lang.org/
|
||||
|#
|
||||
28 7 #"wxtext\0"
|
||||
3 1 6 #"wxtab\0"
|
||||
1 1 8 #"wximage\0"
|
||||
2 0 8 #"wxmedia\0"
|
||||
4 1 34 #"(lib \"syntax-browser.ss\" \"mrlib\")\0"
|
||||
1 0 16 #"drscheme:number\0"
|
||||
3 0 44 #"(lib \"number-snip.ss\" \"drscheme\" \"private\")\0"
|
||||
1 0 36 #"(lib \"comment-snip.ss\" \"framework\")\0"
|
||||
1 0 43 #"(lib \"collapsed-snipclass.ss\" \"framework\")\0"
|
||||
0 0 19 #"drscheme:sexp-snip\0"
|
||||
0 0 36 #"(lib \"cache-image-snip.ss\" \"mrlib\")\0"
|
||||
1 0 68
|
||||
(
|
||||
#"((lib \"image-core.ss\" \"mrlib\") (lib \"image-core-wxme.rkt\" \"mr"
|
||||
#"lib\"))\0"
|
||||
) 1 0 33 #"(lib \"bullet-snip.ss\" \"browser\")\0"
|
||||
0 0 29 #"drscheme:bindings-snipclass%\0"
|
||||
1 0 25 #"(lib \"matrix.ss\" \"htdp\")\0"
|
||||
1 0 22 #"drscheme:lambda-snip%\0"
|
||||
1 0 57
|
||||
#"(lib \"hrule-snip.rkt\" \"macro-debugger\" \"syntax-browser\")\0"
|
||||
1 0 45 #"(lib \"image-snipr.ss\" \"slideshow\" \"private\")\0"
|
||||
1 0 26 #"drscheme:pict-value-snip%\0"
|
||||
0 0 38 #"(lib \"pict-snipclass.ss\" \"slideshow\")\0"
|
||||
2 0 55 #"(lib \"vertical-separator-snip.ss\" \"stepper\" \"private\")\0"
|
||||
1 0 18 #"drscheme:xml-snip\0"
|
||||
1 0 31 #"(lib \"xml-snipclass.ss\" \"xml\")\0"
|
||||
1 0 21 #"drscheme:scheme-snip\0"
|
||||
2 0 34 #"(lib \"scheme-snipclass.ss\" \"xml\")\0"
|
||||
1 0 10 #"text-box%\0"
|
||||
1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0"
|
||||
1 0 15 #"test-case-box%\0"
|
||||
2 0 1 6 #"wxloc\0"
|
||||
0 0 57 0 1 #"\0"
|
||||
0 75 1 #"\0"
|
||||
0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9
|
||||
#"Standard\0"
|
||||
0 75 10 #"Monospace\0"
|
||||
0 13 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 24
|
||||
#"framework:default-color\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 15
|
||||
#"text:ports out\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1
|
||||
-1 2 15 #"text:ports err\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1
|
||||
-1 2 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 17
|
||||
#"text:ports value\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
|
||||
-1 2 27 #"Matching Parenthesis Style\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
|
||||
-1 2 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 37
|
||||
#"framework:syntax-color:scheme:symbol\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 38
|
||||
#"framework:syntax-color:scheme:keyword\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2
|
||||
38 #"framework:syntax-color:scheme:comment\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 37
|
||||
#"framework:syntax-color:scheme:string\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 39
|
||||
#"framework:syntax-color:scheme:constant\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 42
|
||||
#"framework:syntax-color:scheme:parenthesis\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
|
||||
#"framework:syntax-color:scheme:error\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 36
|
||||
#"framework:syntax-color:scheme:other\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2
|
||||
38 #"drracket:check-syntax:lexically-bound\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 28
|
||||
#"drracket:check-syntax:set!d\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 31
|
||||
#"drracket:check-syntax:imported\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 47
|
||||
#"drracket:check-syntax:my-obligation-style-pref\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 50
|
||||
#"drracket:check-syntax:their-obligation-style-pref\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 48
|
||||
#"drracket:check-syntax:unk-obligation-style-pref\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
|
||||
49 #"drracket:check-syntax:both-obligation-style-pref\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
|
||||
26 #"plt:htdp:test-coverage-on\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 2 27
|
||||
#"plt:htdp:test-coverage-off\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 70 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 4 4 #"XML\0"
|
||||
0 70 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 2 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 34 139 34 0 0 0 -1 -1 2 37
|
||||
#"plt:module-language:test-coverage-on\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 34 139 34 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 176 48 96 0 0 0 -1 -1 2 38
|
||||
#"plt:module-language:test-coverage-off\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 176 48 96 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 71 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 4 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
|
||||
-1 4 1 #"\0"
|
||||
0 71 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
|
||||
-1 4 1 #"\0"
|
||||
0 71 1 #"\0"
|
||||
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 100 0 0 0 0 -1
|
||||
-1 0 1 #"\0"
|
||||
0 75 10 #"Monospace\0"
|
||||
0.0 13 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
|
||||
255 255 1 -1 4 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 255 0 -1 -1 0
|
||||
1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 200 0 0 0 0 0 -1 -1 0 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
0 10 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 2 1 #"\0"
|
||||
0 -1 1 #"\0"
|
||||
0 10 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
|
||||
-1 -1 0 35 0 26 3 12 #"#lang planet"
|
||||
0 0 26 3 15 #" dyoo/whalesong"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 7 #"require"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 6 #"planet"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 14 3 20 #"dyoo/whalesong/image"
|
||||
0 0 22 3 2 #"))"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 24 29 1 #"\n"
|
||||
0 0 22 3 1 #"("
|
||||
0 0 15 3 6 #"define"
|
||||
0 0 24 3 1 #" "
|
||||
0 0 14 3 6 #"a-snip"
|
||||
0 0 24 3 1 #" "
|
||||
0 2 35 4 1 #"\0"
|
||||
2 -1.0 -1.0 0.0 0.0 0 12 500
|
||||
(
|
||||
#"\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0X\0\0\0U\b"
|
||||
#"\6\0\0\0\315\v#\352\0\0\0\6bKGD\0\377\0\377\0\377\240\275\247"
|
||||
#"\223\0\0\25\355IDATx\234\355"
|
||||
#"\234Y\254\34\305\271\200\277\252\236\231\263"
|
||||
#"y7\266\317\361n\360\2\266\3\16\306\vf7\216\223\\ \21I\20\302\271\220"
|
||||
#"D\212\24\244D\21\nW\271I$\256P\224\227(/\311KP\36\22\31\t\2"
|
||||
#"\17(\4\"\24\226k.\4\204\314*\300\6cb\233\v\266\217}\354\30\373\370"
|
||||
#",\263tW\325}\250\251\236\232\236\356Y\354c@W\374R\251{z\252{\252"
|
||||
#"\276\371\373\257\277\376Z\4`\370LH"
|
||||
#"\16\350\5\246\0\223\200n\244\314c\214"
|
||||
#" \b\24RV\20\242H\30\236\306\230Q\240\4h\314g\244\364Y\"\370\224\0"
|
||||
#"O\236<\203\201\201\305,^\274\224y"
|
||||
#"\363\26\323\337\337O>?\235R\251\207#Gr\274\367^\300\256]\206R\311\0"
|
||||
#"\32!\24P\301\230q`\24)?F\210#\b\361\21B\374/Qt\4\30\377"
|
||||
#"\314\1\377D\1\367\317[\304\232\265\353"
|
||||
#"\270l\375:\226-[\312\254i\323\350)\4H\t\306h\300T\217\2320\324\34"
|
||||
#"8\240y\350!\315\363\317k@\1\272Z\\\355\235G\3008\360/\204\330\207\20"
|
||||
#"\273\201\177b\314\360g\2\3669\a\334=e\n\3536ld\363\225W\261f\356"
|
||||
#"\\f\227K\344N\17C>\217\276\350"
|
||||
#"B\30\230\213\bCL\225\206\326\272\232"
|
||||
#"\24Bh\224R\334\177\277b\373v\205"
|
||||
#"\205\234\226\34p\2002B\34C\312\335\300kh\375A\374\354OC\316\31\340I"
|
||||
#"\347\235\307\346u\353\270i\351RV\236"
|
||||
#"\32\246g\317\273\210\375\373\221'O\22"
|
||||
#"\0\1 \346\314\201{\357\305|\365\253\230\361q\2141(\245\352\222"
|
||||
#"\326\nc\"~\363\233\210G\37\215\260\32\353\222\362\216>lU-\305"
|
||||
) 500
|
||||
(
|
||||
#"(\260\27)_\4\366\242\265\342\223\226"
|
||||
#"\t\a\234\v\2\256\17\2\266\255X\301\3120\244g\377~raH\36\310c\233"
|
||||
#"2\a\30\300L\232\204\371\323\237\320["
|
||||
#"\267\242\307\307QJ\21E\21a\30\306G\255#FFB\356\2743\344\335wC"
|
||||
#",\324\260\232\34d\22745\350\316\214"
|
||||
#"\24\221\362=\204\370\37\264\336\377\211\232"
|
||||
#"\216\211\3,\4\253\244\344\373\300\225Z\323g\f]X\277\240\e(`\341\n@"
|
||||
#"V\217N\314\300\0\321\263\317\22.YB8>N\30\206T*\225\272\243\224!"
|
||||
#";vD\334uW\5\255\35d?\371\327\2346\373\347\32\30A\210\327\201\3470"
|
||||
#"\346\324\204T\273\225\4\300\275g\373\220"
|
||||
#"B\20\360\357R\3623\245Xk\fS\201\31\300t\254\323\325\203\5\3544\327\1"
|
||||
#"vI\216\216\22\f\16\222\273\3556d\20 \204\250K\0J\t\346\3177\354\334"
|
||||
#"i8z\324\375rR7\4\351b\252)\a,\0\226\"\345\bp\354l\253\336"
|
||||
#"R\316\32\360\202|\236\377\22\202mQ"
|
||||
#"\304\0\26\354L\240\17k\22\222\332\232%b\357^\344e\227\21\254\\I %"
|
||||
#"R\312:\300\0]] \4\354\330\341"
|
||||
#"\337i\22\347\315~\315\201\356\303\230\345"
|
||||
#"\4A7p\220\232\315\236x9+\300\353s9~\245\24W(\305L,\330I"
|
||||
#"\325\207:\333\343\252\233Uu\207G\0"
|
||||
#"\346\360a\304\355\267\23\344\363\4A\200"
|
||||
#"\224\262>\257\201\376~\303\323O\303\360"
|
||||
#"p\22\254\361\236\226f\365\222\337I\214"
|
||||
#"\231\17\364c!\227\332\253t\207rf"
|
||||
#"\200\205\340+A\300\275J\261\22\230\205"
|
||||
#"5\ay\352!f\235\223\270\356\276\23"
|
||||
#"\207\16\301\365\327\303\242EH)c\310\316\3152\6&O6\34?\16\257\276\n"
|
||||
#"\265F\314\207\353\334\265,\310&q>\23k6\216\0#mT\2763"
|
||||
#"\351\34\260\224|+\b\370\231R,\1fc\315A\253\27\323IS\2156"
|
||||
) 500
|
||||
(
|
||||
#"\6\272\273\341\206\el^!bSa\277\266P\246L1\374\345/\20E\256\323"
|
||||
#"\221\246\301\311\224U\"S\255\301B\244"
|
||||
#"\34\302\230\341\246\325\357Td\353,\236"
|
||||
#"\b\301\267\202\200\377\210\"\26b\341v{_\247U+\r\256;O{\241\3153"
|
||||
#"\317`\306\306\354\2711H)\351\352\352"
|
||||
#"\242\273\273\233\256\256.\244,\260jU"
|
||||
#"\201\265ks\330F\313\245\254&4\231dF\232\211\3267\20\4\363;B\322J"
|
||||
#":\2\374oRrw\30\262\0\v\267\340}\3474\322\177\345I|NBO\263"
|
||||
#"\323|\360\1\274\365V|\335A.\24\ntuu\221\317\27\350\353\313s\323M"
|
||||
#"i\236u\328\341\375\232\179\r\366L\224\372j\265v\23#m\3^/%"
|
||||
#"\377\251T\254\271\371\304\367\311\327=\v"
|
||||
#"t\332\365\272<J!^z\311^\367\274\210 \bb\310B\24\270\376\372<3"
|
||||
#"g&\265\327O\355h\262\17\331\3353\v\330\212\20S\332E\323T\332\2\2740"
|
||||
#"\227\343\347\306\260\b8\257Z\245s*;w\246^\316\345r\24\n\5\202 \317"
|
||||
#"\222%y\266nm\246\305I\r\365%"
|
||||
#"\313\\\270\373\347b\314\265\b\221T\243\316\245%\340\236 \340ncXi\f3"
|
||||
#"\2517\v\347Lv\357\206\361\361\206\313"
|
||||
#"B\b\362\371<\371\274\205|\353\255yr\271,;\354\203N{w \333&\a"
|
||||
#"\300\5\300ZD\362\226\16\2459`!\330&\4\327V\375\334IM\2626\363<"
|
||||
#"\233Ij\236\217>\262)E\244\224\344r9\214\311\261~}\216\215\e;\201\333"
|
||||
#"\314P\371Z\35\0y\214\271\4!\26\265Q\213li\n\370\vB\360\355(b"
|
||||
#"\0060\255\305\203\322\376\350\266zpi"
|
||||
#"\27\213E\370\360\303\364\374B\20\4\1"
|
||||
#"A\220\243\247'\340\333\337N\263\275I3Q\347mg\224B\244\334"
|
||||
#"\327\207\326\e\260\235\3753\223L\300\5!\370\276\326\314\303v\177\203"
|
||||
) 500
|
||||
(
|
||||
#"\254\214g mE\227j\1\207\6\261"
|
||||
#"\200\3\224\222l\331\"Y\261\"\315\216"
|
||||
#"\266c\"|\361\363\372\317\231\3\254n\247\304\231OM\225/K\311F`2g"
|
||||
#"\363\377\245K[fMf\277\\N\213\205\b\230>=`\333\266,\367,M{"
|
||||
#"\333\321d\227\334[q!\266\307\327\271"
|
||||
#"\244\326bj\20p\213\326L\6\246R\363W\323:\20YQ\200\254NG\333i"
|
||||
#"`\300\36\215\211\23\20\37]7:\212$_\373\232d\336\274\206\30]\n0'"
|
||||
#"\315\376\3424wn2\260\272.\360\324"
|
||||
#"\256\244\2\336\n\254\250\206\35\375\236Z"
|
||||
#"\332\377\237,~\332\365\216\323\244I\210"
|
||||
#"%K\354y\"l\351\316]\254\2$\375\375\222[n\311\202\332\252qKJ\22"
|
||||
#"\2563\27\v\261Njg\322\0x\262"
|
||||
#"\20\334\240\24\223\260\261\334\316\372\322\331"
|
||||
#"\322N|+\226\345\313a\341\302\372\274"
|
||||
#"\211a\b\a\331j\261\340\e\337\220\314"
|
||||
#"\234\331\nr\273\222\346U\364a\314\212"
|
||||
#"\16\236a\245\201\337\345\300Rj#\21I\311\n\233\264j\270|3\223&uf"
|
||||
#"\346\252\2530\371|\235i\250\313kL\235fk-Y\270Pp\323M\376\257\245"
|
||||
#"\275[\315 \247EM\222\232<\37k4\333\227:\300\201\224l\26\202n,`"
|
||||
#"\337s\310*f\263&#)\315\356\255C\261uk\235y\240z\336\360\274\0302"
|
||||
#"h\r\337\374\246\240\257/\313\307\315\372"
|
||||
#"\334\254\264\376Q\2\275\b\2610#\177"
|
||||
#"\272\324\1^\"%\27iM\36\253\275"
|
||||
#"\235\233\364\t\220\205\va\323\246\246Y"
|
||||
#"\322\354r\24\t\226-\23l\336\234z\307Y\24\250\336T\0303\217\306HL\266"
|
||||
#"\324\1^\217\r\234\27314h\35ame\32Z\231\204\206t\343\215\230i\323"
|
||||
#"jy\306\3060\17?\2149q\242vo\325l$\207\224\214\201\233o"
|
||||
#"\206\\\333\301\222\264Q\21'i\346E\2\323\20bz\273?P\3\234\3"
|
||||
) 500
|
||||
(
|
||||
#"\326x\332\353\227\261\35\210\355\346q)"
|
||||
#"U\247\202\0\261m[\3557\225\202;"
|
||||
#"\357\204\333n\203\273\356\302\37oO\263"
|
||||
#"\315Q\4_\370\2\254Y\223\374e\262"
|
||||
#"~1\221'\2536\276\231\350\302\0163\265'1\340~!X\24259j\203\225"
|
||||
#"\311\3077sv\262\212/\0\223\30%"
|
||||
#"\26B\200\20\215\317\331\260\1\326\257\257"
|
||||
#"]\373\363\237\341\201\al\276\a\37\204"
|
||||
#"\307\37\267\371\274\21\16\37\264\326\206B"
|
||||
#"\1n\2741Y\212$\264\266\372\222\244"
|
||||
#"kq\2001\347\321\256\177\25\347Z\212"
|
||||
#"u\247\375~P\326hD\326\365\3642\212\354<B\324\353\327\17~\0yk\337"
|
||||
#"\304\3600\342W\277\212\3575\306\300\275"
|
||||
#"\367\3328\205\177\215z\320\225\212a\303"
|
||||
#"\6\303\300@\253\341\242,\343\227V\313"
|
||||
#"\270\300\325\343d\254\e\320Z\244\253\350"
|
||||
#"r)\353\302%\311\"5\353\261e\25\307\1lj\277\2356._\216\271\371\346"
|
||||
#"Z\236\207\36\302\274\377~}\3767\337"
|
||||
#"\204\307\36k\350\341\371Ik\230>\335"
|
||||
#"p\355\265\311\32\264+\255\f\236\300\232"
|
||||
#"\211\366\3345\t \205`\00153\236\366b4\353\261\371\307\264\342dy\243u"
|
||||
#"&\342G?BL\236l?\27\213\210\373\356kx\6\0\277\375-\224\313 D"
|
||||
#"<Q\260\36\260&\212\f\327]g(\24Z5\315\355^O\326(\300jqk"
|
||||
#"\221\0\223\204`\246R\251\0Z\375\237"
|
||||
#"\231\337\245\371\255i\367\32\3\313\226!"
|
||||
#"\356\270\243\326\0>\372(\274\375v\303"
|
||||
#"=\2\340\345\227\21O>\211\366\0'!G\221\341\374\363\r_\374b;\357^"
|
||||
#"\262&Y5J\226\244\3\300S\215a\n\3557`\255z\363\235\212\270\373n\230"
|
||||
#":\325\376V\245\2\277\373]\363g\377"
|
||||
#"\376\367\3500\254\3\354\203\326\332 \245"
|
||||
#"a\353\3264\357\240\231\321J\346K-m5\3654+a"
|
||||
#",\26\260\326\24\252\217t\223?\233\275\\\355\372\303-\253"
|
||||
) 500
|
||||
(
|
||||
#"c\ff\315\32\314\355\267\327\236\363\364"
|
||||
#"\323\230W_mn\273\237{\16\365\362\313\250 \310\204\\.k\326\2541,Y"
|
||||
#"\322\256\211h\347{'\316\16\267v\270-`!\2204\2\316\322hR\276k\370"
|
||||
#"/\215ii\307\21\2\356\271\az{"
|
||||
#"\3555c\340\276\373\20\325{\263\356\323"
|
||||
#"\225\n\352\301\aQ)f\242\366\331\320"
|
||||
#"\323\243\371\322\227\222\23S\232ih+"
|
||||
#"\225\361\363H\332\6\334\27\4\30\352'"
|
||||
#"}\352D\30635\5\231\367\31\203\370"
|
||||
#"\362\227\341\353_\257]{\353-\304\263"
|
||||
#"\317\266|\246\6\324\343\217\243>\372\b"
|
||||
#"\225\230\264\355C\256T\f\e7\32f\315j\69\353\35\245E^I;]f"
|
||||
#"\t\220S\252N{\335,\333\263\226\254"
|
||||
#"\231\316\306@o/\346\227\277\204\300\v"
|
||||
#")m\337\16\245\346\223\360\f\325\231\300"
|
||||
#"\203\203\250g\236A\5Au&|\243\231\210\"\303\264i\326\243h\17p\253\306"
|
||||
#"0i&\332\264\3019h\0\0346\271\251#m\316\202\374\275\357!\326\255\253="
|
||||
#"\353\304\tx\344\221\226\217\363\25@="
|
||||
#"\362\bQ\261\230j\207-dM\245\242\271\342\n;\237\255V\313f\r\\\362\330"
|
||||
#"\354\17h\23\260\277vGa\341\226\231"
|
||||
#"\300Y\263\306\324\247y\363\340\27\277\210"
|
||||
#"\277\26\0\177\373\e\34>\334\3741\324"
|
||||
#"\346\261+ z\3555\324\356\335()"
|
||||
#"\23\353:j\220\243\310\232\210+\257\364W&ub*\332\371#\262E\2\204\306"
|
||||
#"\304\366\327\301-\323\\\213\317J\356\271"
|
||||
#"\a\346\316\255}\326\32\356\277\277\345m\21P\241\266:#*\225PO<a\201"
|
||||
#"\247\230\t\247\305ah\270\352*Co"
|
||||
#"\357\331\300Mj\277\246m\300%\352\227"
|
||||
#"\225\224\253\327\312m=\242C\271\372j"
|
||||
#"\370\356w\353\257\275\366\32\274\364R\323"
|
||||
#"\333\3542\304Z\31\343\2450O=\205\32\32BiM\24"
|
||||
#"Eu\240k=;\315\2349\232\r\e:\321\342f\220\225"
|
||||
) 500
|
||||
(
|
||||
#"W\202\346\"\1F\202\0\177\355N\5"
|
||||
#"\vw\234\t\326\342\356n\370\365\257\355Z\0_\266o\207J%\3636]-S"
|
||||
#"\235\366V\217\352\320!\324\213/\22U"
|
||||
#"}\342\306e`:\206|\3155\232\236"
|
||||
#"\236\264\305\214i\266\31\32\301\372\311\255"
|
||||
#"pj.\22\340t\265\360I\300\245j"
|
||||
#"\2320-\276\343\16\330\270\261\376\332\261"
|
||||
#"c\360\327\277f\336\342\354\256\178\271\246(z\352)T\251\224\351MhmW"
|
||||
#"\216\316\236\255Y\2736\253\241\313j\340"
|
||||
#"\322\362*\332m\245$\300\2601\214SS|\337L\214U+\346W8\t<\355"
|
||||
#"sC\261g\315\202\237\377\334\236\273\270"
|
||||
#"\1`\36}\24\216\34\311\254\252+\213"
|
||||
#"\203\353C\216\275\2117\337D\355\337\217"
|
||||
#"\22\242\1\262\377Y)\303\25W\30\272"
|
||||
#"\272\222\320\374e\ai6W\247\234;\303\332\6\340\21c8Em\t_\245z"
|
||||
#"{\21k&\306\250\375W\255b\23~"
|
||||
#"\236\272\236\336\217\177\f\213\27\333s\27"
|
||||
#"x\17C\304\366\355\251\367$\341\372\32"
|
||||
#"\334\0\271TB=\367\234]\r\227\200\352\2470\324\f\fh.\271\244\35-N"
|
||||
#"3!~jo\321\214m\344\214\341\30\265\206\304\1v\220G\253G\377\205H\276"
|
||||
#"H\376yC\272\340\2\314\17\177X\313W\325^^x\1\363\312+\r\325s6"
|
||||
#"\3275\264>\344\6\355u\351\205\27P\247N\241\22P\e\3356\315\246M\332\v"
|
||||
#"e\266j\364\222`\235\201jo\301L\34[?(D\235\e\344\354\260\323b\267"
|
||||
#"CCX\375\331d\f\302]K\215_\334}7L\237^\37\203\0\314\37\376`"
|
||||
#"]4\357Y\356O\316\202\233l\350b"
|
||||
#"\320\207\16\241\337z\253\251O\354\0\17"
|
||||
#"\f\30V\257n\267As6\327\a\354\324\256\3\300\37R\363}]\205\212^\32"
|
||||
#"\253\246qj\326\307\25-\253\323(\0\261z5\334"
|
||||
#"qGc\b\364\335w\21O<Qg\22|\323T\246"
|
||||
) 500
|
||||
(
|
||||
#"\21p&\\\227\376\361\17T\24\241\32l\257\362\2\3626]~\271&\237\317Z"
|
||||
#"\6\226f\177\265\367\213\356\235\356\0\360"
|
||||
#"a)9A\255\241s\25r\356\332h\25\260\323h\a:\244\361%\303?\376\364"
|
||||
#"\247\230\276\276\372\241\35\300\374\361\217\230"
|
||||
#"\261\261\330\341qo\213\323\\wL\203"
|
||||
#"\233\265*9\332\265\vu\370p\323\0\2201\246j\213\r\253V\2455fI\250"
|
||||
#"*q\36b\375\256\366\24251\340\323"
|
||||
#"Z\363\241\224\261\375\363+\355\240\216T"
|
||||
#"\217\3765\367\271L-\n\27\267\311\227"
|
||||
#"]\6\267\334R\367\203F\b\364\321\243"
|
||||
#"\250\207\36\"\244\246\261\16\256K\345D"
|
||||
#"J\323\334\6-\36\eC\275\361F\34"
|
||||
#"\306L\203\353\17-\255_o\310\347\333"
|
||||
#"\361y}\r\256\0\355\257\245\213\3\232"
|
||||
#"\306\30\366\n\301%\325\317\25\262\27C9\255K[\343\23\337#\4\342'?A"
|
||||
#"tu\305\0212\2555\246\273\e\375\360\303\350#Gb\235HnH\340\373\271\255"
|
||||
#"\216\r\240_~\31u\305\25\261\211\310"
|
||||
#"\262\305\306\330\221\347\213.2\274\375v"
|
||||
#"\26\\\177\245\276o\36Nw\16\30\340"
|
||||
#"}c8\201\235\244\351\0\247\5\334\r"
|
||||
#"\215k{\32\346\225o\334\210\330\262\5"
|
||||
#"q\362$.\242\246\0013<\214\331\276\275\341\5Ln\257\221\266IAS\260."
|
||||
#"}\370!\352\203\17\320\213\0265hn"
|
||||
#"\332\260\322\272u\206={\254\331\310\326"
|
||||
#"\\\337p\236\302\276Sg\0\370TU\213g\30C\205\332\242\356\244g`\260\263"
|
||||
#"\177\222p]~)%\342\316;\355\310\304\350\250\35\2767\6\272\2720;v\240"
|
||||
#"w\355\252\353\325'59\rtS\323\340\237+\205~\375u\364\242E\231\376p"
|
||||
#"-^\254\351\3577\254X\241\331\275;\253D~\0w\f8\3366\334\6\300\0"
|
||||
#"o\0\27c\207\364\222\246\301\301u?\357\366\200\250\203"
|
||||
#"\v\210M\233\220\e7Z\355\365\304\204!<\360\200\255"
|
||||
) 500
|
||||
(
|
||||
#"$\365\16\220\177L\3\227\4\236\266\345"
|
||||
#"F\374B\357\332\205\332\274\31](d\216<\373Z|\351\245\206={\2549i"
|
||||
#",\215\337\f\177L'\346!\25\360A!\330'\4+\265\216\315\204\3\234f\376"
|
||||
#"s$VE\344r\210\357|\a\21Ev\2048\376\245\34\354\331\203y\341\205\206"
|
||||
#"6;Y\235\210t\330Y@\ev\3549q\2\375\376\373\230\213/\306$F\237"
|
||||
#"\223\220\303\320F\332\26/V\354\337\237\324\\\277a\263;[5\16\246u\bX"
|
||||
#"i\315+A\300\22jf\300\327\336\344"
|
||||
#"\213\324E\302\366^}5\342\342\213\355"
|
||||
#"\324'\177nDw7\346\261\307\354\346"
|
||||
#"Gd7)\311\246\245\31\314\264}\247\342\3637\337D\257Z\25\367\354|;\234"
|
||||
#"\264\311B(V\257\326\348\2400&\371d\247\275'\261\366\2673I\35\26\335"
|
||||
#"\247\24\373\244d\245\326\2619o\346z"
|
||||
#"\27\34\334\356n\304\255\267\"\312e\253"
|
||||
#"\301\16\260\224p\342\4\346\311'\e\\"
|
||||
#"\372\3443\223\260\322^\332\264\353\376w"
|
||||
#"\6\320\373\366\241\217\37GO\235\332\0"
|
||||
#"\326\377l=\r\315\334\271\212\331\263\25CCip\213X\355\355<x\233\nX"
|
||||
#"\3/\32\303\2\354N\n\255\0GTgd^w\35\342\202\v\20\325\355\bb"
|
||||
#"\300]]\360\374\363\230\243G\e\302)"
|
||||
#"\255\334\373V\300\323\376\30\3\250R\t"
|
||||
#"\275g\17f\323&tu_\266\344\320"
|
||||
#"\276\337\31\221R\261l\231\178\242\326"
|
||||
#"\3459Q\5\334\271d\16\354\0374\2067\204\340rcj\35\a\32\315D\256z"
|
||||
#"\f{{\311\337x#\262X\4\245jp\205\260\301\364\277\377\275\341\31YA\301"
|
||||
#"V\16S\22\256\237|\233n\336y\a\275vmK\270.\315\237\257\350\356V\224"
|
||||
#"J~D\344\0240H\247\266\267%`\200\235B\260\320\30\6R\0'"
|
||||
#"\e\236\334\225W\22\315\236Mn|\274n\257\35\221\317c\336y\a\366"
|
||||
) 500
|
||||
(
|
||||
#"\354\211\237\341\216~\27;\t\331\375F\226\371H\206`\322B4zp\02034"
|
||||
#"\204\2313\247)\\7\324\324\335\255\230"
|
||||
#"7O\261\177\277\203;\212\335\231\2523"
|
||||
#"\317\301\227\246\263\210G\265\346\205\\."
|
||||
#"\36:\362\343\1~\214\240\334\327G\371\232k(\216\215Q,\26)\225J\204a"
|
||||
#"h\367=\213\"\302\35;\b\225\252\213"
|
||||
#"\210\245\216\257Q\337\241H\372\301i\336"
|
||||
#"D\232\231\210\377\260(B\357\335\eO\24L\323Z\a7\212\"\242H1o\236"
|
||||
#"\263\273\343X\323pv[\177\265\234\246"
|
||||
#"\375O\245xU\312\272\20\246\e^r\237\303\r\e(\317\234Iyl\214R\251"
|
||||
#"\24\247\212R\204\207\16\21\276\362J\3\320$\314,\310ip\323LD\362Z\f"
|
||||
#"y\357^t\261\330\0004\rr\245\22"
|
||||
#"\322\327W\246\267\267\204\365\32\216P?"
|
||||
#"\236\323\271\264\236\\e\f;\261\v\302W$*\221\3to/z\303\6\202b"
|
||||
#"\21\5\361\342@Y\235\320-w\356D\216\216\3061\fh\36\240O6|Y\346"
|
||||
#"#\353\330\220\377\370q\324\340 \252\277"
|
||||
#"\37\355\305%|\315UJ\21\206!\245R\211(*2y\3620\343\343\23\263\v"
|
||||
#"U[\353q\"cx\26\353\27\317\247\36r\260f\rz\3324T\251T\aW"
|
||||
#"J\211\254T\220\325\355a\222\35\26h"
|
||||
#"\16\270\35\350iP\el\266\326\250\3"
|
||||
#"\a\320s\346\304\200\223\232\353\340\26\213"
|
||||
#"E\206\207\207\211\242A\316\324kHJ"
|
||||
#"\333\v\236F\201\377\6\276\202\335\263G"
|
||||
#"\3\272\273\233\374\245\227\242\313eDu"
|
||||
#"\363\2428\25\n\210}\373\220\207\16\305"
|
||||
#"q\214d\360\250\325\230B\26\364$\334\264^a\235\3718p\0\275fM\34\210"
|
||||
#"\367\223\17\367\324\251S\f\r\rq\362d\366V\n\235JG\333\357|\f<#"
|
||||
#"%[\264f\26\240/\274\20=e\n\271R\251\272"
|
||||
#"\275@u\2373)\221B _\177\35\241u\313e\b"
|
||||
) 500
|
||||
(
|
||||
#"\220\256\315\355hr\263\360x\234N\234"
|
||||
#"@\35;\206\2321\303\216xxp\313"
|
||||
#"\345r\35\334\303\207\17\243\275a\254\263"
|
||||
#"\225\216\3677:\2565O\t\301\346\\"
|
||||
#"\216\376\213.B\25\213\344\204 \227\313"
|
||||
#"\305[\f\310 @\214\214 \337{\257%\330\344\347v4:\315g\316\362\243\25"
|
||||
#"X\323p\360 j\3324T\24\21E\21\225J\205J\245B\251Tbxx\230"
|
||||
#"\243G\2172888\241p\341\f7\220\372\330\30\236\221\222+\207\207Y0u"
|
||||
#"*Q.GNkr\371<\271|\36\31\4\310}\373\20\247O\327\201\365\355p"
|
||||
#"\226\230\224c\226\6\247\331\341,mV"
|
||||
#"\a\17\242\226/'\254\202-\227\313\24K%FN\237\346\310\341\303\f\35?>"
|
||||
#"\341p\241\276\315\351X\272\273\273Y\273"
|
||||
#"v-+\346\317'\37E\4\245\22\271\321Qr\243\243\4\a\16 N\236\314\236"
|
||||
#"\335N#\350\244\366\372\327:1\23\251"
|
||||
#"]\354|\236p\313\26*\205\2\245\361"
|
||||
#"q\306\306\307\31\376\370c\216\f\16r"
|
||||
#"rx\370\314!\264\220\263\2\f6\336"
|
||||
#"\260\274P\340\222J\205\311\306\20\320z"
|
||||
#"\243C\377\307}i\0057\313.\247v\223i\f\227W\226.\245\270`\1##"
|
||||
#"#\234\32\32\342\350\320\20\243M\346\304M\204\2345`'3\2005X7\316\355"
|
||||
#"\302\232\265\17_Z!H\24\244\35\310"
|
||||
#"iv\330\a\233\234\320X\4N\367\366"
|
||||
#"\362\257 \340\330\310\310\304\314\342o!"
|
||||
#"\23\6\30,\310\363\201\213\260\353 \375"
|
||||
#"\rY\342\215\361i\324\3464\260\376y"
|
||||
#"\26\3304{\254\251\357\35\272\250\3028\266ov\234s\261\211m\266L(`'"
|
||||
#"\275\300\5B\260\330\230x\303\346\206a%\322\375b\22\347\255:#\311ASg"
|
||||
#"\22|\260\247\261Q\205\223\347\242\262"
|
||||
#"-\344\234\0v\322\v,\22\202\371\325\r\226\234\351H"
|
||||
#"&\177\354/)\315\32\270d\360\307\245\nvx\3624\326"
|
||||
) 188
|
||||
(
|
||||
#"w\37\256\346\3714\344\234\2v\222\307"
|
||||
#"n\3576\200\335}\314\355G\2216\2432M\262\\3gg}s0\216\5z"
|
||||
#"\n\333\373\374\24456)\237\b`_"
|
||||
#"z\260\r\342\f\254\235\356\301\216\353\371"
|
||||
#"\235\20\2238\317r\301\\\3035\16\214\n\301(0Z]o\362Y\221O\34\260"
|
||||
#"/\201\20\364\30C/\325]\256\204\240`L\274!H@\343p~\b\224\205\240"
|
||||
#"dL<\335\252\302\247\257\251Y\362\251"
|
||||
#"\2\316\22Au\352\225\277\205\214\20\250"
|
||||
#"\2545w\237a\371L\2\376\377$\23"
|
||||
#"\265\261\337\347\222!\237\3>\307\3629\340s,\237\3>\307\362"
|
||||
#"\177z\314\306\205O<{Y\0\0\0\0IEND\256B`\202"
|
||||
) 0 0 22 3 1 #")"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 11 #"image-width"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 14 3 6 #"a-snip"
|
||||
0 0 22 3 1 #")"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 12 #"image-height"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 14 3 6 #"a-snip"
|
||||
0 0 22 3 1 #")"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 14 3 6 #"a-snip"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0
|
|
@ -1,7 +1,7 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/resource
|
||||
whalesong/image)
|
||||
(require (planet dyoo/whalesong/resource)
|
||||
(planet dyoo/whalesong/image))
|
||||
|
||||
(define-resource whale-resource "images/humpback.jpg")
|
||||
(define-resource self-resource "using-resources.rkt")
|
|
@ -1,7 +1,7 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/world
|
||||
whalesong/image)
|
||||
(require (planet dyoo/whalesong/world)
|
||||
(planet dyoo/whalesong/image))
|
||||
|
||||
(define-struct world (x direction))
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#lang whalesong
|
||||
#lang planet dyoo/whalesong
|
||||
|
||||
(require whalesong/js)
|
||||
(require (planet dyoo/whalesong/js))
|
||||
|
||||
(when (in-javascript-context?)
|
||||
(viewport-width))
|
|
@ -12,7 +12,7 @@
|
|||
;; my-image-url: (parameterof stx)
|
||||
;;
|
||||
;; During the dynamic extent of expand-out-images, this will be defined
|
||||
;; as the unique name for the image-url function in whalesong/image.
|
||||
;; as the unique name for the image-url function in (planet dyoo/whalesong/image).
|
||||
(define-runtime-path whalesong/image
|
||||
"image.rkt")
|
||||
(define my-image-url (make-parameter #f))
|
||||
|
@ -208,4 +208,4 @@
|
|||
(define-values-for-syntax ids #,(on-expr #'expr)))]
|
||||
|
||||
[else
|
||||
(on-expr stx)]))
|
||||
(on-expr stx)]))
|
|
@ -77,7 +77,6 @@
|
|||
(define (get-compiled-code-from-port ip)
|
||||
;(printf "get-compiled-code-from-port\n")
|
||||
(parameterize ([read-accept-reader #t]
|
||||
[read-accept-lang #t]
|
||||
;; Note: we're trying to preserve the context, to avoid code expansion.
|
||||
[compile-context-preservation-enabled #t]
|
||||
[current-namespace base-namespace])
|
7
image/main.rkt
Normal file
7
image/main.rkt
Normal file
|
@ -0,0 +1,7 @@
|
|||
#lang s-exp "../lang/base.rkt"
|
||||
|
||||
(require "private/main.rkt"
|
||||
"private/color.rkt")
|
||||
|
||||
(provide (all-from-out "private/main.rkt")
|
||||
(all-from-out "private/color.rkt"))
|
|
@ -2,7 +2,7 @@
|
|||
// JavaScript land...
|
||||
|
||||
|
||||
var colorNamespace = MACHINE.modules['whalesong/image/private/color.rkt'].getExternalExports();
|
||||
var colorNamespace = MACHINE.modules['whalesong/image/private/color.rkt'].getNamespace();
|
||||
var colorStruct = colorNamespace.get('struct:color');
|
||||
var makeColor = function(r,g,b,a) { return colorStruct.constructor([r,g,b,a]); };
|
||||
|
|
@ -4,7 +4,6 @@ var makeClosure = plt.baselib.functions.makeClosure;
|
|||
var finalizeClosureCall = plt.baselib.functions.finalizeClosureCall;
|
||||
var PAUSE = plt.runtime.PAUSE;
|
||||
|
||||
var checkSymbolOrString = plt.baselib.check.checkSymbolOrString;
|
||||
|
||||
var isString = plt.baselib.strings.isString;
|
||||
var isSymbol = plt.baselib.symbols.isSymbol;
|
||||
|
@ -37,12 +36,9 @@ var isFontWeight = function(x){
|
|||
|| (x === false); // false is also acceptable
|
||||
};
|
||||
var isMode = function(x) {
|
||||
return ((isString(x) || isSymbol(x)) &&
|
||||
(x.toString().toLowerCase() == "solid" ||
|
||||
x.toString().toLowerCase() == "outline")) ||
|
||||
((jsnums.isReal(x)) &&
|
||||
(jsnums.greaterThanOrEqual(x, 0) &&
|
||||
jsnums.lessThanOrEqual(x, 255)));
|
||||
return ((isString(x) || isSymbol(x)) &&
|
||||
(x.toString().toLowerCase() == "solid" ||
|
||||
x.toString().toLowerCase() == "outline"));
|
||||
};
|
||||
|
||||
var isPlaceX = function(x) {
|
||||
|
@ -70,24 +66,8 @@ var isStyle = function(x) {
|
|||
|
||||
|
||||
|
||||
// Useful trigonometric functions based on htdp teachpack
|
||||
|
||||
// excess : compute the Euclidean excess
|
||||
// Note: If the excess is 0, then C is 90 deg.
|
||||
// If the excess is negative, then C is obtuse.
|
||||
// If the excess is positive, then C is acuse.
|
||||
function excess(sideA, sideB, sideC) {
|
||||
return sideA*sideA + sideB*sideB - sideC*sideC;
|
||||
}
|
||||
|
||||
// return c^2 = a^2 + b^2 - 2ab cos(C)
|
||||
function cosRel(sideA, sideB, angleC) {
|
||||
return (sideA*sideA) + (sideB*sideB) - (2*sideA*sideB*Math.cos(angleC * Math.PI/180));
|
||||
}
|
||||
|
||||
var less = function(lhs, rhs) {
|
||||
return (rhs - lhs) > 0.00001;
|
||||
}
|
||||
|
||||
var checkString = plt.baselib.check.checkString;
|
||||
var checkStringOrFalse = plt.baselib.check.makeCheckArgumentType(
|
||||
|
@ -152,14 +132,11 @@ var checkPlaceY = plt.baselib.check.makeCheckArgumentType(
|
|||
var checkAngle = plt.baselib.check.makeCheckArgumentType(
|
||||
isAngle,
|
||||
"finite real number between 0 and 360");
|
||||
var checkRotateAngle = plt.baselib.check.makeCheckArgumentType(
|
||||
isRotateAngle,
|
||||
"finite real number between -360 and 360");
|
||||
|
||||
|
||||
var checkMode = plt.baselib.check.makeCheckArgumentType(
|
||||
isMode,
|
||||
'solid or outline or [0-255]');
|
||||
'solid or outline');
|
||||
|
||||
|
||||
var checkSideCount = plt.baselib.check.makeCheckArgumentType(
|
||||
|
@ -183,17 +160,9 @@ var checkListofColor = plt.baselib.check.makeCheckListofArgumentType(
|
|||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
EXPORTS['image=?'] =
|
||||
makePrimitiveProcedure(
|
||||
'image=?',
|
||||
2,
|
||||
function(MACHINE) {
|
||||
var img1 = checkImageOrScene(MACHINE,'image=?', 0);
|
||||
var img2 = checkImageOrScene(MACHINE,'image=?', 1);
|
||||
return img1.equals(img2);
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
EXPORTS['image-color?'] =
|
||||
|
@ -352,90 +321,6 @@ EXPORTS['image-url'] =
|
|||
'image-url');
|
||||
|
||||
|
||||
EXPORTS['video/url'] =
|
||||
makeClosure(
|
||||
'video/url',
|
||||
1,
|
||||
function(MACHINE) {
|
||||
var path = checkString(MACHINE, 'video/url', 0);
|
||||
PAUSE(
|
||||
function(restart) {
|
||||
var rawVideo = document.createElement('video');
|
||||
rawVideo.src = path.toString();
|
||||
rawVideo.addEventListener('canplay', function() {
|
||||
restart(function(MACHINE) {
|
||||
function pause(){ rawVideo.pause(); return true;};
|
||||
finalizeClosureCall(
|
||||
MACHINE,
|
||||
makeFileVideo(path.toString(), rawVideo));
|
||||
// aState.addBreakRequestedListener(pause);
|
||||
});
|
||||
});
|
||||
rawVideo.addEventListener('error', function(e) {
|
||||
restart(function(MACHINE) {
|
||||
plt.baselib.exceptions.raiseFailure(
|
||||
MACHINE,
|
||||
plt.baselib.format.format(
|
||||
"unable to load ~a: ~a",
|
||||
[url,
|
||||
e.message]));
|
||||
});
|
||||
});
|
||||
rawVideo.src = path.toString();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// We keep a cache of loaded sounds:
|
||||
var audioCache = {};
|
||||
|
||||
EXPORTS['play-sound'] =
|
||||
makeClosure(
|
||||
'play-sound',
|
||||
1,
|
||||
function(MACHINE) {
|
||||
var path = checkString(MACHINE, 'play-sound', 0);
|
||||
var fileAudio = audioCache[path];
|
||||
if (fileAudio) {
|
||||
// the sound was already loaded
|
||||
finalizeClosureCall(
|
||||
MACHINE,
|
||||
fileAudio.play());
|
||||
}
|
||||
else {
|
||||
// this sound has never been played before
|
||||
PAUSE(
|
||||
function(restart) {
|
||||
fileAudio = makeFileAudio(path.toString());
|
||||
audioCache[path] = fileAudio;
|
||||
// let the audio file load before playing...
|
||||
fileAudio.loading = true;
|
||||
// (fileAudio.audio is the raw html5 Audio object)
|
||||
fileAudio.audio.addEventListener('canplay', function() {
|
||||
// ignore canplay events that follow the initial load
|
||||
if(fileAudio.loading) {
|
||||
restart(function(MACHINE) {
|
||||
finalizeClosureCall(
|
||||
MACHINE,
|
||||
fileAudio.play());
|
||||
});
|
||||
fileAudio.loading = false; // we're done loading
|
||||
}
|
||||
})
|
||||
fileAudio.audio.addEventListener('error', function(e) {
|
||||
restart(function(MACHINE) {
|
||||
plt.baselib.exceptions.raiseFailure(
|
||||
MACHINE,
|
||||
plt.baselib.format.format(
|
||||
"unable to load ~a: ~a",
|
||||
[path,
|
||||
e.message]));
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
EXPORTS['overlay'] =
|
||||
|
@ -474,22 +359,6 @@ EXPORTS['overlay/xy'] =
|
|||
jsnums.toFixnum(deltaY));
|
||||
});
|
||||
|
||||
EXPORTS['overlay/offset'] =
|
||||
makePrimitiveProcedure(
|
||||
'overlay/offset',
|
||||
4,
|
||||
function(MACHINE) {
|
||||
var img1 = checkImage(MACHINE, "overlay/offset", 0);
|
||||
var deltaX = checkReal(MACHINE, "overlay/offset", 1);
|
||||
var deltaY = checkReal(MACHINE, "overlay/offset", 2);
|
||||
var img2 = checkImage(MACHINE, "overlay/offset", 3);
|
||||
var middleX = (img1.getWidth() - img2.getWidth()) / 2;
|
||||
var middleY = (img1.getHeight() - img2.getHeight()) / 2;
|
||||
return makeOverlayImage(img1,
|
||||
img2,
|
||||
jsnums.toFixnum(middleX) + deltaX,
|
||||
jsnums.toFixnum(middleY) + deltaY);
|
||||
});
|
||||
|
||||
|
||||
EXPORTS['overlay/align'] =
|
||||
|
@ -556,23 +425,6 @@ EXPORTS['underlay/xy'] =
|
|||
-(jsnums.toFixnum(deltaY)));
|
||||
});
|
||||
|
||||
EXPORTS['underlay/offset'] =
|
||||
makePrimitiveProcedure(
|
||||
'underlay/offset',
|
||||
4,
|
||||
function(MACHINE) {
|
||||
var img1 = checkImage(MACHINE, "underlay/offset", 0);
|
||||
var deltaX = checkReal(MACHINE, "underlay/offset", 1);
|
||||
var deltaY = checkReal(MACHINE, "underlay/offset", 2);
|
||||
var img2 = checkImage(MACHINE, "underlay/offset", 3);
|
||||
var middleX = (img1.getWidth() - img2.getWidth()) / 2;
|
||||
var middleY = (img1.getHeight() - img2.getHeight()) / 2;
|
||||
return makeOverlayImage(img2,
|
||||
img1,
|
||||
-(jsnums.toFixnum(middleX) + deltaX),
|
||||
-(jsnums.toFixnum(middleY) + deltaY));
|
||||
});
|
||||
|
||||
EXPORTS['underlay/align'] =
|
||||
makePrimitiveProcedure(
|
||||
'underlay/align',
|
||||
|
@ -717,42 +569,16 @@ EXPORTS['above/align'] =
|
|||
EXPORTS['empty-scene'] =
|
||||
makePrimitiveProcedure(
|
||||
'empty-scene',
|
||||
plt.baselib.lists.makeList(2, 3),
|
||||
2,
|
||||
function(MACHINE) {
|
||||
var width = checkNonNegativeReal(MACHINE, 'empty-scene', 0);
|
||||
var height = checkNonNegativeReal(MACHINE, 'empty-scene', 1);
|
||||
var color = (MACHINE.a===3)? checkColor(MACHINE, 'empty-scene', 2) : null;
|
||||
|
||||
return makeSceneImage(jsnums.toFixnum(width),
|
||||
return makeSceneImage(jsnums.toFixnum(width),
|
||||
jsnums.toFixnum(height),
|
||||
color,
|
||||
[],
|
||||
true);
|
||||
});
|
||||
|
||||
EXPORTS['put-image'] =
|
||||
makePrimitiveProcedure(
|
||||
'put-image',
|
||||
4,
|
||||
function(MACHINE) {
|
||||
var picture = checkImage(MACHINE, "put-image", 0);
|
||||
var x = checkReal(MACHINE, "put-image", 1);
|
||||
var y = checkReal(MACHINE, "put-image", 2);
|
||||
var background = checkImageOrScene(MACHINE, "place-image", 3);
|
||||
if (isScene(background)) {
|
||||
return background.add(picture, jsnums.toFixnum(x), background.getHeight() - jsnums.toFixnum(y));
|
||||
} else {
|
||||
var newScene = makeSceneImage(background.getWidth(),
|
||||
background.getHeight(),
|
||||
null,
|
||||
[],
|
||||
false);
|
||||
newScene = newScene.add(background, background.getWidth()/2, background.getHeight()/2);
|
||||
newScene = newScene.add(picture, jsnums.toFixnum(x), background.getHeight() - jsnums.toFixnum(y));
|
||||
return newScene;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
EXPORTS['place-image'] =
|
||||
|
@ -767,13 +593,12 @@ EXPORTS['place-image'] =
|
|||
if (isScene(background)) {
|
||||
return background.add(picture, jsnums.toFixnum(x), jsnums.toFixnum(y));
|
||||
} else {
|
||||
var newScene = makeSceneImage(background.getWidth(),
|
||||
background.getHeight(),
|
||||
null,
|
||||
[],
|
||||
false);
|
||||
newScene = newScene.add(background, background.getWidth()/2, background.getHeight()/2);
|
||||
newScene = newScene.add(picture, jsnums.toFixnum(x), jsnums.toFixnum(y));
|
||||
var newScene = makeSceneImage(background.getWidth(),
|
||||
background.getHeight(),
|
||||
[],
|
||||
false);
|
||||
newScene = newScene.add(background.updatePinhole(0, 0), 0, 0);
|
||||
newScene = newScene.add(picture, jsnums.toFixnum(x), jsnums.toFixnum(y));
|
||||
return newScene;
|
||||
}
|
||||
|
||||
|
@ -787,55 +612,49 @@ EXPORTS['place-image/align'] =
|
|||
6,
|
||||
function(MACHINE) {
|
||||
var img = checkImage(MACHINE, "place-image/align", 0);
|
||||
var x = jsnums.toFixnum(checkReal(MACHINE, "place-image/align", 1));
|
||||
var y = jsnums.toFixnum(checkReal(MACHINE, "place-image/align", 2));
|
||||
var x = checkReal(MACHINE, "place-image/align", 1);
|
||||
var y = checkReal(MACHINE, "place-image/align", 2);
|
||||
var placeX = checkPlaceX(MACHINE, "place-image/align", 3);
|
||||
var placeY = checkPlaceY(MACHINE, "place-image/align", 4);
|
||||
var background = checkImageOrScene(MACHINE, "place-image/align", 5);
|
||||
|
||||
var pinholeX = img.pinholeX || img.getWidth() / 2;
|
||||
var pinholeY = img.pinholeY || img.getHeight() / 2;
|
||||
|
||||
// calculate x and y based on placeX and placeY
|
||||
if (placeX == "left") x = x + pinholeX;
|
||||
else if (placeX == "right") x = x - pinholeX;
|
||||
if (placeY == "top") y = y + pinholeY;
|
||||
else if (placeY == "bottom") y = y - pinholeY;
|
||||
if (placeX == "left") x = x + img.pinholeX;
|
||||
else if (placeX == "right") x = x - img.pinholeX;
|
||||
if (placeY == "top") y = y + img.pinholeY;
|
||||
else if (placeY == "bottom") y = y - img.pinholeY;
|
||||
|
||||
if (isScene(background)) {
|
||||
return background.add(img, x, y);
|
||||
return background.add(img, jsnums.toFixnum(x), jsnums.toFixnum(y));
|
||||
} else {
|
||||
var newScene = makeSceneImage(background.getWidth(),
|
||||
background.getHeight(),
|
||||
null,
|
||||
[],
|
||||
false);
|
||||
newScene = newScene.add(background, background.getWidth()/2, background.getHeight()/2);
|
||||
newScene = newScene.add(img, x, y);
|
||||
var newScene = makeSceneImage(background.getWidth(),
|
||||
background.getHeight(),
|
||||
[],
|
||||
false);
|
||||
newScene = newScene.add(background.updatePinhole(0, 0), 0, 0);
|
||||
newScene = newScene.add(img, jsnums.toFixnum(x), jsnums.toFixnum(y));
|
||||
return newScene;
|
||||
}
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// rotate: angle image -> image
|
||||
// Rotates image by angle degrees in a counter-clockwise direction.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
EXPORTS['rotate'] =
|
||||
makePrimitiveProcedure(
|
||||
'rotate',
|
||||
2,
|
||||
function(MACHINE) {
|
||||
var angle = checkRotateAngle(MACHINE, "rotate", 0);
|
||||
var angle360 = angle % 360;
|
||||
var angle = checkAngle(MACHINE, "rotate", 0);
|
||||
var img = checkImage(MACHINE, "rotate", 1);
|
||||
// convert to clockwise rotation for makeRotateImage
|
||||
if (angle360 < 0) {
|
||||
return makeRotateImage(jsnums.toFixnum(-(360 + angle360)), img);
|
||||
} else {
|
||||
return makeRotateImage(jsnums.toFixnum(-angle360), img);
|
||||
}
|
||||
return makeRotateImage(jsnums.toFixnum(-angle), img);
|
||||
});
|
||||
|
||||
|
||||
|
||||
EXPORTS['scale'] =
|
||||
makePrimitiveProcedure(
|
||||
'scale',
|
||||
|
@ -963,21 +782,18 @@ EXPORTS['scene+line'] =
|
|||
var y2 = checkReal(MACHINE, "scene+line", 4);
|
||||
var c = checkColor(MACHINE, "scene+line", 5);
|
||||
// make a scene containing the image
|
||||
var newScene = makeSceneImage(jsnums.toFixnum(img.getWidth()),
|
||||
jsnums.toFixnum(img.getHeight()),
|
||||
null,
|
||||
[],
|
||||
false);
|
||||
newScene = newScene.add(img, img.getWidth()/2, img.getHeight()/2);
|
||||
var newScene = makeSceneImage(jsnums.toFixnum(img.getWidth()),
|
||||
jsnums.toFixnum(img.getHeight()),
|
||||
[],
|
||||
true);
|
||||
newScene = newScene.add(img.updatePinhole(0, 0), 0, 0);
|
||||
// make an image containing the line
|
||||
var line = makeLineImage(jsnums.toFixnum(x2-x1),
|
||||
jsnums.toFixnum(y2-y1),
|
||||
c,
|
||||
false),
|
||||
leftMost = Math.min(x1,x2),
|
||||
topMost = Math.min(y1,y2);
|
||||
jsnums.toFixnum(y2-y1),
|
||||
c,
|
||||
false);
|
||||
// add the line to scene, offset by the original amount
|
||||
return newScene.add(line, line.getWidth()/2+leftMost, line.getHeight()/2+topMost);
|
||||
return newScene.add(line, jsnums.toFixnum(x1), jsnums.toFixnum(y1));
|
||||
});
|
||||
|
||||
|
||||
|
@ -1019,27 +835,9 @@ EXPORTS['rectangle'] =
|
|||
s.toString(),
|
||||
c);
|
||||
});
|
||||
/*
|
||||
|
||||
need to port over checks for isListofPosns and isListOfLength
|
||||
|
||||
EXPORTS['polygon'] =
|
||||
makePrimitiveProcedure(
|
||||
'polygon',
|
||||
3,
|
||||
function(MACHINE) {
|
||||
function isPosnList(lst){ return isListOf(lst, types.isPosn); }
|
||||
var points = checkListOfLength(MACHINE, "polygon", 0);
|
||||
var points = checkListOfPosns(MACHINE, "polygon", 0);
|
||||
var s = checkMode(MACHINE, "polygon", 2);
|
||||
var c = checkColor(MACHINE, "polygon", 3);
|
||||
return makePosnImage(points,
|
||||
s.toString(),
|
||||
c);
|
||||
});
|
||||
|
||||
*/
|
||||
EXPORTS['regular-polygon'] =
|
||||
EXPORTS['regular-polygon'] =
|
||||
makePrimitiveProcedure(
|
||||
'regular-polygon',
|
||||
4,
|
||||
|
@ -1081,219 +879,14 @@ EXPORTS['triangle'] =
|
|||
var s = checkNonNegativeReal(MACHINE, "triangle", 0);
|
||||
var m = checkMode(MACHINE, "triangle", 1);
|
||||
var c = checkColor(MACHINE, "triangle", 2);
|
||||
return makeTriangleImage(jsnums.toFixnum(s),
|
||||
jsnums.toFixnum(360-60),
|
||||
jsnums.toFixnum(s),
|
||||
m.toString(),
|
||||
c);
|
||||
return makeTriangleImage(jsnums.toFixnum(s),
|
||||
60,
|
||||
m.toString(),
|
||||
c);
|
||||
});
|
||||
|
||||
|
||||
EXPORTS['triangle/sas'] =
|
||||
makePrimitiveProcedure(
|
||||
'triangle/sas',
|
||||
5,
|
||||
function(MACHINE) {
|
||||
var sideA = checkNonNegativeReal(MACHINE, "triangle/sas", 0);
|
||||
var angleB = checkAngle(MACHINE, "triangle/sas", 1);
|
||||
var sideC = checkNonNegativeReal(MACHINE, "triangle/sas", 2);
|
||||
var style = checkMode(MACHINE, "triangle/sas", 3);
|
||||
var color = checkColor(MACHINE, "triangle/sas", 4);
|
||||
// cast to fixnums
|
||||
sideA = jsnums.toFixnum(sideA); angleB = jsnums.toFixnum(angleB); sideC = jsnums.toFixnum(sideC);
|
||||
var sideB2 = cosRel(sideA, sideC, angleB);
|
||||
var sideB = Math.sqrt(sideB2);
|
||||
|
||||
if (sideB2 <= 0) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given side, angle and side will not form a triangle: "
|
||||
+ sideA + ", " + angleB + ", " + sideC, []) );
|
||||
} else {
|
||||
if (less(sideA + sideC, sideB) ||
|
||||
less(sideB + sideC, sideA) ||
|
||||
less(sideA + sideB, sideC)) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given side, angle and side will not form a triangle: "
|
||||
+ sideA + ", " + angleB + ", " + sideC, []) );
|
||||
}
|
||||
}
|
||||
|
||||
var angleA = Math.acos(excess(sideB, sideC, sideA) / (2 * sideB * sideC)) * (180 / Math.PI);
|
||||
|
||||
return makeTriangleImage(jsnums.toFixnum(sideC),
|
||||
jsnums.toFixnum(angleA),
|
||||
jsnums.toFixnum(sideB),
|
||||
style.toString(),
|
||||
color);
|
||||
});
|
||||
|
||||
EXPORTS['triangle/sss'] =
|
||||
makePrimitiveProcedure(
|
||||
'triangle/sss',
|
||||
5,
|
||||
function(MACHINE) {
|
||||
var sideA = checkNonNegativeReal(MACHINE, "triangle/sss", 0);
|
||||
var sideB = checkNonNegativeReal(MACHINE, "triangle/sss", 1);
|
||||
var sideC = checkNonNegativeReal(MACHINE, "triangle/sss", 2);
|
||||
var style = checkMode(MACHINE, "triangle/sss", 3);
|
||||
var color = checkColor(MACHINE, "triangle/sss", 4);
|
||||
// cast to fixnums
|
||||
sideA = jsnums.toFixnum(sideA); sideB = jsnums.toFixnum(sideB); sideC = jsnums.toFixnum(sideC);
|
||||
if (less(sideA + sideB, sideC) ||
|
||||
less(sideC + sideB, sideA) ||
|
||||
less(sideA + sideC, sideB)) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given sides will not form a triangle: "
|
||||
+ sideA+", "+sideB+", "+sideC, []) );
|
||||
}
|
||||
|
||||
var angleA = Math.acos(excess(sideB, sideC, sideA) / (2 * sideB * sideC)) * (180 / Math.PI);
|
||||
return makeTriangleImage(jsnums.toFixnum(sideC),
|
||||
jsnums.toFixnum(angleA),
|
||||
jsnums.toFixnum(sideB),
|
||||
style.toString(),
|
||||
color);
|
||||
});
|
||||
|
||||
EXPORTS['triangle/ass'] =
|
||||
makePrimitiveProcedure(
|
||||
'triangle/ass',
|
||||
5,
|
||||
function(MACHINE) {
|
||||
var angleA = checkAngle(MACHINE, "triangle/ass", 0);
|
||||
var sideB = checkNonNegativeReal(MACHINE, "triangle/ass", 1);
|
||||
var sideC = checkNonNegativeReal(MACHINE, "triangle/ass", 2);
|
||||
var style = checkMode(MACHINE, "triangle/ass", 3);
|
||||
var color = checkColor(MACHINE, "triangle/ass", 4);
|
||||
// cast to fixnums
|
||||
angleA = jsnums.toFixnum(angleA); sideB = jsnums.toFixnum(sideB); sideC = jsnums.toFixnum(sideC);
|
||||
if (colorDb.get(color)) { color = colorDb.get(color); }
|
||||
if (less(180, angleA)) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given angle, side and side will not form a triangle: "
|
||||
+ angleA + ", " + sideB + ", " + sideC, []) );
|
||||
}
|
||||
return makeTriangleImage(jsnums.toFixnum(sideC),
|
||||
jsnums.toFixnum(angleA),
|
||||
jsnums.toFixnum(sideB),
|
||||
style.toString(),
|
||||
color);
|
||||
});
|
||||
|
||||
EXPORTS['triangle/ssa'] =
|
||||
makePrimitiveProcedure(
|
||||
'triangle/ssa',
|
||||
5,
|
||||
function(MACHINE) {
|
||||
var sideA = checkNonNegativeReal(MACHINE, "triangle/ssa", 0);
|
||||
var sideB = checkNonNegativeReal(MACHINE, "triangle/ssa", 1);
|
||||
var angleC = checkAngle(MACHINE, "triangle/ssa", 2);
|
||||
var style = checkMode(MACHINE, "triangle/ssa", 3);
|
||||
var color = checkColor(MACHINE, "triangle/ssa", 4);
|
||||
// cast to fixnums
|
||||
sideA = jsnums.toFixnum(sideA); sideB = jsnums.toFixnum(sideB); angleC = jsnums.toFixnum(angleC);
|
||||
if (less(180, angleC)) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given side, side and angle will not form a triangle: "
|
||||
+ sideA + ", " + sideB + ", " + angleC, []) );
|
||||
}
|
||||
var sideC2 = cosRel(sideA, sideB, angleC);
|
||||
var sideC = Math.sqrt(sideC2);
|
||||
|
||||
if (sideC2 <= 0) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given side, side and angle will not form a triangle: "
|
||||
+ sideA + ", " + sideB + ", " + angleC, []) );
|
||||
} else {
|
||||
if (less(sideA + sideB, sideC) ||
|
||||
less(sideC + sideB, sideA) ||
|
||||
less(sideA + sideC, sideB)) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given side, side and angle will not form a triangle: "
|
||||
+ sideA + ", " + sideB + ", " + angleC, []) );
|
||||
}
|
||||
}
|
||||
|
||||
var angleA = Math.acos(excess(sideB, sideC, sideA) / (2 * sideB * sideC)) * (180 / Math.PI);
|
||||
return makeTriangleImage(jsnums.toFixnum(sideC),
|
||||
jsnums.toFixnum(angleA),
|
||||
jsnums.toFixnum(sideB),
|
||||
style.toString(),
|
||||
color);
|
||||
});
|
||||
|
||||
EXPORTS['triangle/aas'] =
|
||||
makePrimitiveProcedure(
|
||||
'triangle/aas',
|
||||
5,
|
||||
function(MACHINE) {
|
||||
var angleA = checkAngle(MACHINE, "triangle/aas", 0);
|
||||
var angleB = checkAngle(MACHINE, "triangle/aas", 1);
|
||||
var sideC = checkNonNegativeReal(MACHINE, "triangle/aas", 2);
|
||||
var style = checkMode(MACHINE, "triangle/aas", 3);
|
||||
var color = checkColor(MACHINE, "triangle/aas", 4);
|
||||
// cast to fixnums
|
||||
var angleA = jsnums.toFixnum(angleA); angleB = jsnums.toFixnum(angleB); sideC = jsnums.toFixnum(sideC);
|
||||
var angleC = (180 - angleA - angleB);
|
||||
if (less(angleC, 0)) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given angle, angle and side will not form a triangle: "
|
||||
+ angleA + ", " + angleB + ", " + sideC, []) );
|
||||
}
|
||||
var hypotenuse = sideC / (Math.sin(angleC*Math.PI/180))
|
||||
var sideB = hypotenuse * Math.sin(angleB*Math.PI/180);
|
||||
return makeTriangleImage(jsnums.toFixnum(sideC),
|
||||
jsnums.toFixnum(angleA),
|
||||
jsnums.toFixnum(sideB),
|
||||
style.toString(),
|
||||
color);
|
||||
});
|
||||
|
||||
|
||||
EXPORTS['triangle/asa'] =
|
||||
makePrimitiveProcedure(
|
||||
'triangle/asa',
|
||||
5,
|
||||
function(MACHINE) {
|
||||
var angleA = checkAngle(MACHINE, "triangle/asa", 0);
|
||||
var sideB = checkNonNegativeReal(MACHINE, "triangle/asa", 1);
|
||||
var angleC = checkAngle(MACHINE, "triangle/asa", 2);
|
||||
var style = checkMode(MACHINE, "triangle/asa", 3);
|
||||
var color = checkColor(MACHINE, "triangle/asa", 4);
|
||||
// cast to fixnums
|
||||
var angleA = jsnums.toFixnum(angleA); sideB = jsnums.toFixnum(sideB); angleC = jsnums.toFixnum(angleC);
|
||||
var angleB = (180 - angleA - angleC);
|
||||
if (less(angleB, 0)) {
|
||||
raise( types.incompleteExn(types.exnFailContract, "The given angle, side and angle will not form a triangle: "
|
||||
+ angleA + ", " + sideB + ", " + angleC, []) );
|
||||
}
|
||||
var base = (sideB * Math.sin(angleA*Math.PI/180)) / (Math.sin(angleB*Math.PI/180));
|
||||
var sideC = (sideB * Math.sin(angleC*Math.PI/180)) / (Math.sin(angleB*Math.PI/180));
|
||||
return makeTriangleImage(jsnums.toFixnum(sideC),
|
||||
jsnums.toFixnum(angleA),
|
||||
jsnums.toFixnum(sideB),
|
||||
style.toString(),
|
||||
color);
|
||||
});
|
||||
|
||||
EXPORTS['triangle/saa'] =
|
||||
makePrimitiveProcedure(
|
||||
'triangle/saa',
|
||||
5,
|
||||
function(MACHINE) {
|
||||
var sideA = checkNonNegativeReal(MACHINE, "triangle/saa", 0);
|
||||
var angleB = checkAngle(MACHINE, "triangle/saa", 1);
|
||||
var angleC = checkAngle(MACHINE, "triangle/saa", 2);
|
||||
var style = checkMode(MACHINE, "triangle/saa", 3);
|
||||
var color = checkColor(MACHINE, "triangle/saa", 4);
|
||||
// cast to fixnums
|
||||
var sideA = jsnums.toFixnum(sideA); angleB = jsnums.toFixnum(angleB); angleC = jsnums.toFixnum(angleC);
|
||||
var angleA = (180 - angleC - angleB);
|
||||
var hypotenuse = sideA / (Math.sin(angleA*Math.PI/180));
|
||||
var sideC = hypotenuse * Math.sin(angleC*Math.PI/180);
|
||||
var sideB = hypotenuse * Math.sin(angleB*Math.PI/180);
|
||||
return makeTriangleImage(jsnums.toFixnum(sideC),
|
||||
jsnums.toFixnum(angleA),
|
||||
jsnums.toFixnum(sideB),
|
||||
style.toString(),
|
||||
color);
|
||||
});
|
||||
|
||||
|
||||
|
||||
EXPORTS['right-triangle'] =
|
||||
EXPORTS['right-triangle'] =
|
||||
makePrimitiveProcedure(
|
||||
'right-triangle',
|
||||
4,
|
||||
|
@ -1302,11 +895,10 @@ EXPORTS['right-triangle'] =
|
|||
var side2 = checkNonNegativeReal(MACHINE, "right-triangle", 1);
|
||||
var s = checkMode(MACHINE, "right-triangle", 2);
|
||||
var c = checkColor(MACHINE, "right-triangle", 3);
|
||||
return makeTriangleImage(jsnums.toFixnum(side1),
|
||||
jsnums.toFixnum(360-90),
|
||||
jsnums.toFixnum(side2),
|
||||
s.toString(),
|
||||
c);
|
||||
return makeRightTriangleImage(jsnums.toFixnum(side1),
|
||||
jsnums.toFixnum(side2),
|
||||
s.toString(),
|
||||
c);
|
||||
});
|
||||
|
||||
|
||||
|
@ -1316,18 +908,13 @@ EXPORTS['isosceles-triangle'] =
|
|||
4,
|
||||
function(MACHINE) {
|
||||
var side = checkNonNegativeReal(MACHINE, "isosceles-triangle", 0);
|
||||
var angleC = checkAngle(MACHINE, "isosceles-triangle", 1);
|
||||
var angle = checkAngle(MACHINE, "isosceles-triangle", 1);
|
||||
var s = checkMode(MACHINE, "isosceles-triangle", 2);
|
||||
var c = checkColor(MACHINE, "isosceles-triangle", 3);
|
||||
// cast to fixnums
|
||||
side = jsnums.toFixnum(side); angleC = jsnums.toFixnum(angleC);
|
||||
var angleAB = (180-angleC)/2;
|
||||
var base = 2*side*Math.sin((angleC*Math.PI/180)/2);
|
||||
return makeTriangleImage(jsnums.toFixnum(base),
|
||||
jsnums.toFixnum(360-angleAB),// add 180 to make the triangle point up
|
||||
jsnums.toFixnum(side),
|
||||
s.toString(),
|
||||
c);
|
||||
return makeTriangleImage(jsnums.toFixnum(side),
|
||||
jsnums.toFixnum(angle),
|
||||
s.toString(),
|
||||
c);
|
||||
});
|
||||
|
||||
|
||||
|
@ -1442,22 +1029,6 @@ EXPORTS['color-list->image'] =
|
|||
pinholeY);
|
||||
});
|
||||
|
||||
EXPORTS['color-list->bitmap'] =
|
||||
makePrimitiveProcedure(
|
||||
'color-list->image',
|
||||
3,
|
||||
function(MACHINE) {
|
||||
var listOfColors = checkListofColor(MACHINE, 'color-list->image', 0);
|
||||
var width = checkNatural(MACHINE, 'color-list->image', 1);
|
||||
var height = checkNatural(MACHINE, 'color-list->image', 2);
|
||||
return colorListToImage(listOfColors,
|
||||
width,
|
||||
height,
|
||||
0,
|
||||
0);
|
||||
});
|
||||
|
||||
|
||||
EXPORTS['image-width'] =
|
||||
makePrimitiveProcedure(
|
||||
'image-width',
|
||||
|
@ -1486,12 +1057,7 @@ EXPORTS['image-baseline'] =
|
|||
});
|
||||
|
||||
|
||||
EXPORTS['name->color'] =
|
||||
makePrimitiveProcedure(
|
||||
'name->color',
|
||||
1,
|
||||
function(MACHINE) {
|
||||
var name = checkSymbolOrString(MACHINE, 'name->color', 0);
|
||||
var result = colorDb.get('' + name) || false;
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
1672
image/private/kernel.js
Normal file
1672
image/private/kernel.js
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -12,18 +12,15 @@
|
|||
"js-impl.js")
|
||||
#:provided-values (text
|
||||
text/font
|
||||
|
||||
|
||||
bitmap/url
|
||||
image-url ;; older name for bitmap/url
|
||||
open-image-url ;; older name for bitmap/url
|
||||
video/url
|
||||
play-sound
|
||||
|
||||
overlay
|
||||
overlay/offset
|
||||
overlay/xy
|
||||
overlay/align
|
||||
underlay
|
||||
underlay/offset
|
||||
underlay/xy
|
||||
underlay/align
|
||||
beside
|
||||
|
@ -31,7 +28,6 @@
|
|||
above
|
||||
above/align
|
||||
empty-scene
|
||||
put-image
|
||||
place-image
|
||||
place-image/align
|
||||
rotate
|
||||
|
@ -47,17 +43,9 @@
|
|||
circle
|
||||
square
|
||||
rectangle
|
||||
polygon
|
||||
regular-polygon
|
||||
ellipse
|
||||
triangle
|
||||
triangle/sas
|
||||
triangle/sss
|
||||
triangle/ass
|
||||
triangle/ssa
|
||||
triangle/aas
|
||||
triangle/asa
|
||||
triangle/saa
|
||||
right-triangle
|
||||
isosceles-triangle
|
||||
star
|
||||
|
@ -66,7 +54,6 @@
|
|||
rhombus
|
||||
image->color-list
|
||||
color-list->image
|
||||
color-list->bitmap
|
||||
image-width
|
||||
image-height
|
||||
image-baseline
|
||||
|
@ -77,7 +64,4 @@
|
|||
angle?
|
||||
side-count?
|
||||
step-count?
|
||||
image?
|
||||
image=?
|
||||
name->color
|
||||
))
|
||||
image?))
|
96
image/private/racket-impl.rkt
Normal file
96
image/private/racket-impl.rkt
Normal file
|
@ -0,0 +1,96 @@
|
|||
#lang s-exp "../../lang/base.rkt"
|
||||
|
||||
(require 2htdp/image
|
||||
(for-syntax racket/base))
|
||||
|
||||
(provide text
|
||||
text/font
|
||||
overlay
|
||||
overlay/xy
|
||||
overlay/align
|
||||
underlay
|
||||
underlay/xy
|
||||
underlay/align
|
||||
beside
|
||||
beside/align
|
||||
above
|
||||
above/align
|
||||
empty-scene
|
||||
place-image
|
||||
place-image/align
|
||||
rotate
|
||||
scale
|
||||
scale/xy
|
||||
flip-horizontal
|
||||
flip-vertical
|
||||
frame
|
||||
crop
|
||||
line
|
||||
add-line
|
||||
scene+line
|
||||
circle
|
||||
square
|
||||
rectangle
|
||||
regular-polygon
|
||||
ellipse
|
||||
triangle
|
||||
right-triangle
|
||||
isosceles-triangle
|
||||
star
|
||||
radial-star
|
||||
star-polygon
|
||||
rhombus
|
||||
image->color-list
|
||||
color-list->image
|
||||
image-width
|
||||
image-height
|
||||
image-baseline
|
||||
image-color?
|
||||
mode?
|
||||
x-place?
|
||||
y-place?
|
||||
angle?
|
||||
side-count?
|
||||
image-color?
|
||||
|
||||
|
||||
image?
|
||||
;; Something funky is happening on the Racket side of things with regards
|
||||
;; to step-count? See: http://bugs.racket-lang.org/query/?cmd=view&pr=12031
|
||||
;; step-count?
|
||||
|
||||
bitmap/url
|
||||
)
|
||||
|
||||
|
||||
|
||||
(define-syntax (define-stubs stx)
|
||||
(syntax-case stx ()
|
||||
[(_ f ...)
|
||||
(syntax/loc stx
|
||||
(begin
|
||||
(define f (lambda args (error 'f))) ...))]))
|
||||
|
||||
|
||||
|
||||
(define-stubs color-list->image)
|
||||
|
||||
|
||||
|
||||
|
||||
(define (my-step-count? x)
|
||||
(and (integer? x)
|
||||
(>= x 1)))
|
||||
|
||||
|
||||
(define (png-bytes->image bytes)
|
||||
(error 'png-bytes->image "not implemented yet"))
|
||||
|
||||
|
||||
(define image-url (procedure-rename bitmap/url 'image-url))
|
||||
(define open-image-url (procedure-rename bitmap/url 'open-image-url))
|
||||
|
||||
|
||||
(provide (rename-out [my-step-count? step-count?]
|
||||
[bitmap/url image-url]
|
||||
[bitmap/url open-image-url]))
|
29
info.rkt
29
info.rkt
|
@ -1,2 +1,29 @@
|
|||
#lang setup/infotab
|
||||
(define collection 'multi)
|
||||
|
||||
(define name "Whalesong")
|
||||
(define blurb '("A Racket to JavaScript compiler"))
|
||||
(define release-notes '((p "Corrected list? to be amortized constant time. Implemented bug fixes for issues 79 (view-bind-many), 80 (docs for view-bind-many*), 81 (with-cont-mark). Optimized to reduce some superfluous object allocations.")))
|
||||
(define version "1.15")
|
||||
(define primary-file "make-launcher.rkt")
|
||||
(define categories '(devtools))
|
||||
(define repositories '("4.x"))
|
||||
(define required-core-version "5.1.1")
|
||||
|
||||
;; I am disabling the automatic launchers: it's causing issues with
|
||||
;; file permissions. The program "make-launcher.rkt" will build a
|
||||
;; whalesong launcher, so I need to revise the instructions to use it
|
||||
;; instead.
|
||||
;;
|
||||
;; (define racket-launcher-libraries '("whalesong.rkt"))
|
||||
;; (define racket-launcher-names '("whalesong"))
|
||||
;;
|
||||
|
||||
(define homepage "http://hashcollision.org/whalesong")
|
||||
(define scribblings '(("scribblings/manual.scrbl")))
|
||||
(define compile-omit-paths '("tests"
|
||||
"sandbox"
|
||||
"examples"
|
||||
"experiments"
|
||||
"simulator"
|
||||
"tmp"))
|
||||
(define can-be-loaded-with 'all)
|
||||
|
|
|
@ -95,17 +95,11 @@
|
|||
(format "M.primitives[~s]._i(M)" (symbol->string (ApplyPrimitiveProcedure-name op)))]
|
||||
|
||||
[(ModuleVariable? op)
|
||||
(format "M.modules[~s].getExports().get(~s)"
|
||||
(format "M.modules[~s].getNamespace().get(~s)"
|
||||
(symbol->string
|
||||
(ModuleLocator-name
|
||||
(ModuleVariable-module-name op)))
|
||||
(symbol->string (ModuleVariable-name op)))]
|
||||
|
||||
[(PrimitivesReference? op)
|
||||
(format "M.primitives[~s]" (symbol->string (PrimitivesReference-name op)))]
|
||||
|
||||
[(GlobalsReference? op)
|
||||
(format "(M.globals[~s]!==void(0)?M.globals[~s]:M.params.currentNamespace.get(~s))"
|
||||
(symbol->string (GlobalsReference-name op))
|
||||
(symbol->string (GlobalsReference-name op))
|
||||
(symbol->string (GlobalsReference-name op)))]))
|
||||
(format "M.primitives[~s]" (symbol->string (PrimitivesReference-name op)))]))
|
|
@ -95,7 +95,7 @@
|
|||
rhs))]
|
||||
[(ModuleVariable? target)
|
||||
(lambda: ([rhs : String])
|
||||
(format "M.modules[~s].getExports().set(~s,~s);"
|
||||
(format "M.modules[~s].getNamespace().set(~s,~s);"
|
||||
(symbol->string (ModuleLocator-name (ModuleVariable-module-name target)))
|
||||
(symbol->string (ModuleVariable-name target))
|
||||
rhs))]
|
||||
|
@ -115,8 +115,6 @@
|
|||
(assemble-prefix-reference target)]
|
||||
[(ControlFrameTemporary? target)
|
||||
(assemble-control-frame-temporary target)]
|
||||
[(GlobalsReference? target)
|
||||
(format "M.globals[~s]" (symbol->string (GlobalsReference-name target)))]
|
||||
[(ModulePrefixTarget? target)
|
||||
(format "M.modules[~s].prefix"
|
||||
(symbol->string (ModuleLocator-name (ModulePrefixTarget-path target))))])
|
||||
|
@ -187,7 +185,8 @@
|
|||
(path->string val))]
|
||||
[(vector? val)
|
||||
(format "RT.makeVector([~a])"
|
||||
(string-join (map loop (vector->list val))
|
||||
(string-join (for/list ([elt (vector->list val)])
|
||||
(loop elt))
|
||||
","))]
|
||||
[(box? val)
|
||||
(format "RT.makeBox(~s)"
|
||||
|
@ -497,7 +496,7 @@
|
|||
|
||||
(: assemble-module-variable-ref (ModuleVariable -> String))
|
||||
(define (assemble-module-variable-ref var)
|
||||
(format "M.modules[~s].getExports().get(~s)"
|
||||
(format "M.modules[~s].getNamespace().get(~s)"
|
||||
(symbol->string (ModuleLocator-name (ModuleVariable-module-name var)))
|
||||
(symbol->string (ModuleVariable-name var))))
|
||||
|
||||
|
@ -512,8 +511,7 @@
|
|||
(symbol->string (ModuleLocator-name modname)))]
|
||||
|
||||
[(eq? pred 'linked?)
|
||||
(format "(M.installedModules[~s]!==void(0)&&M.modules[~s]!==undefined)"
|
||||
(symbol->string (ModuleLocator-name modname))
|
||||
(format "(M.modules[~s]!==void(0))"
|
||||
(symbol->string (ModuleLocator-name modname)))]))
|
||||
|
||||
|
||||
|
@ -522,4 +520,4 @@
|
|||
(let ([t (VariableReference-toplevel varref)])
|
||||
(format "(new RT.VariableReference(M.e[M.e.length-~a],~a))"
|
||||
(add1 (ToplevelRef-depth t))
|
||||
(ToplevelRef-pos t))))
|
||||
(ToplevelRef-pos t))))
|
|
@ -16,13 +16,6 @@
|
|||
(define MAX-JAVASCRIPT-ARGS-AT-ONCE 100)
|
||||
|
||||
|
||||
;; Workaround for a regression in Racket 5.3.1:
|
||||
(define-syntax-rule (mycase op ((x ...) b ...) ...)
|
||||
(let ([v op])
|
||||
(cond
|
||||
[(or (eqv? v 'x) ...) b ...] ...)))
|
||||
|
||||
|
||||
(: open-code-kernel-primitive-procedure (CallKernelPrimitiveProcedure Blockht -> String))
|
||||
(define (open-code-kernel-primitive-procedure op blockht)
|
||||
(let*: ([operator : KernelPrimitiveName/Inline (CallKernelPrimitiveProcedure-operator op)]
|
||||
|
@ -43,7 +36,7 @@
|
|||
(build-list (length operands) (lambda: ([i : Natural]) i))
|
||||
operands
|
||||
(CallKernelPrimitiveProcedure-typechecks? op))])
|
||||
(mycase operator
|
||||
(case operator
|
||||
[(+)
|
||||
(cond [(empty? checked-operands)
|
||||
(assemble-numeric-constant 0)]
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user