This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require racket/control | |
gui-debugger/annotator) | |
(provide debug step! set-breakpoint!) | |
;; original and annotated syntax objects | |
(define orig-stx #f) | |
(define ann-stx #f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define a -1) | |
(define b 1) | |
;; original | |
(define x ((λ () | |
(let ([l '()]) | |
(define (loop i) | |
(if (< i b) | |
(begin (append (loop (+ i 1/100)) (list i))) | |
(append l (list i)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to Racket v5.3.0.8. | |
-> (define c (class object% (init [x 0]) (super-new))) | |
-> (define d (class c (init [x 0] [y 0]) (super-instantiate () [x x]))) | |
-> (make-object d 1) | |
(object:d ...) | |
-> (make-object d 1 2) | |
(object:d ...) | |
-> (make-object d 1 2 4) | |
; instantiate: unused initialization arguments: (x 4) for instantiated class: d | |
; [,bt for context] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; What should happen here? | |
(define c% (class object% (super-new) (init a))) | |
(define d% (class c% (super-new) (init #:a))) | |
(new d% #:a 5) ; which `a` does it instantiate? | |
(new d% #:a 5 #:a 6) ; presumably this is not allowed | |
; (if it is, then it's not like keywords) | |
; (if it's not, the above leaves an init un-initialized) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/gui | |
(define frame (make-object frame% "top")) | |
(define parent-panel (make-object panel% frame)) | |
(define panel1 (make-object panel% parent-panel)) | |
(define panel2 (make-object panel% parent-panel)) | |
(send parent-panel delete-child panel2) | |
(new button% | |
[label "Switch to 2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang scribble/base | |
@(module widgets racket/gui | |
(require ffi/unsafe | |
mred/private/wx/gtk/types | |
mred/private/wx/gtk/utils | |
racket/draw/unsafe/cairo | |
slideshow/pict) | |
(provide screenshots) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(make-object (class (class object% | |
(super-new) | |
(init a b c)) | |
(super-new [a 0] [b 0] [c 0]) | |
(init [d 0])) | |
1 2) | |
;; => ; instantiate: unused initialization arguments | |
;; unused arguments: | |
;; [a 2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require racket/control) | |
(define/contract pt | |
(prompt/c (-> (-> integer? integer?))) | |
(make-continuation-prompt-tag)) | |
(define f | |
(reset0-at pt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define pt (make-continuation-prompt-tag)) | |
(call-with-continuation-prompt | |
(lambda () | |
(+ 1 | |
(call-with-composable-continuation | |
(lambda (k) | |
(abort-current-continuation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; ref: http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-di/ | |
(define-signature on-off-device^ | |
(on | |
off)) | |
(define-signature sensor-device^ | |
(is-coffee-present?)) |
OlderNewer