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
;;; | |
;;; General Editing | |
;;; | |
;; When a region is highlighted typed text should replace the selction. | |
(delete-selection-mode 1) | |
;; Bind cmd-z to undo. | |
(global-set-key (kbd "s-z") #'undo) |
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
Process: Defle [49183] | |
Path: /Volumes/VOLUME/*/DefleMask.app/Contents/MacOS/Defle | |
Identifier: com.deflemask.app | |
Version: DefleMask Tracker 12.0.1 (12.0.1) | |
Code Type: X86 (Native) | |
Parent Process: ??? [1] | |
Responsible: Defle [49183] | |
User ID: 501 | |
Date/Time: 2019-09-01 17:37:38.597 +0200 |
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/base | |
(provide uniq) | |
;;; | |
;;; Uniq | |
;;; | |
; The function uniq takes a list as input and returns a new list: | |
; adjacent elements are compared and omits any repeated elements. | |
; In other words, uniq works like the Unix utility uniq, but on list. |
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 | |
;; adapted from: | |
;; https://planet.racket-lang.org/package-source/dyoo/sicp-concurrency.plt/1/2/sicp-concurrency.ss | |
;; concurrency: SICP concurrency primitives | |
;; adapted from http://list.cs.brown.edu/pipermail/plt-scheme/2002-September/000620.html | |
;;; Sources: | |
;;; Dorai Sitaram, "Learn Scheme in a Fixnum of Dayes", chapter 15 | |
;;; Dyvig, http://www.scheme.com/tspl2d/examples.html#g2433 | |
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
(let () | |
(current-namespace (make-base-namespace)) | |
(define (hello) (displayln "Space Invaders!")) | |
(namespace-set-variable-value! 'hello hello) | |
;;; | |
;;; Browser API | |
;;; | |
;;; Time | |
(define now (js-import-from (js-date) "now" 0)) | |
;;; Window |
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 | |
(let ([new-es (make-eventspace)]) | |
(parameterize ([current-eventspace new-es]) | |
(define frame (new frame% | |
[label "Bug demo"])) | |
(define button (new button% | |
[callback | |
(lambda _ |
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 (make-map+fold f) | |
; f : α β -> (values α β) | |
; map f over xs while threading the seconding value | |
(define (f* xs ρ) | |
(match xs | |
['() (values '() ρ)] | |
[(cons x xs) (letv ((x ρ) (f x ρ)) | |
(letv ((xs ρ) (f* xs ρ)) | |
(values (cons x xs) ρ)))])) | |
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
#lang racket | |
(provide (for-syntax x)) | |
(begin-for-syntax | |
(define x 1) | |
(set! x 2)) | |
(define-syntax (foo stx) | |
(syntax-case stx () | |
[(_foo) |
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
mba-5:plt soegaard$ make | |
if [ "" = "" ] ; \ | |
then make plain-in-place PKGS="main-distribution main-distribution-test" ; \ | |
else make cpus-in-place CPUS="" PKGS="main-distribution main-distribution-test" ; fi | |
make base | |
mkdir -p build/config | |
echo '#hash((links-search-files . ()))' > build/config/config.rktd | |
mkdir -p racket/src/build | |
make racket/src/build/Makefile | |
make[3]: `racket/src/build/Makefile' is up to date. |
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 (for-syntax syntax/parse racket/syntax)) | |
(require ffi/unsafe/objc) | |
(require ffi/unsafe | |
ffi/unsafe/objc | |
ffi/unsafe/define | |
mred/private/wx/cocoa/image | |
mred/private/wx/cocoa/types) | |
;;; Bit operations |