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 (rename-out [my-read read] | |
[my-read-syntax read-syntax])) | |
(define (my-read in) (syntax->datum (my-read-syntax #f in))) | |
(define (my-read-syntax src in) | |
(define a (read-syntax src in)) | |
(define b (read-syntax src in)) |
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 | |
(module a-sig racket | |
(provide a^) | |
(define-signature a^ | |
(a))) | |
(module b-sig racket | |
(provide b^) |
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 | |
(module a-sig racket | |
(provide a^) | |
(define-signature a^ | |
(a))) | |
(module a-impl racket | |
(require (submod ".." a-sig) |
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
fun foo b = | |
let exception Foo | |
in if b | |
then (foo (not b)) handle Foo => "caught" | |
else raise Foo | |
end | |
exception Bar | |
fun bar b = | |
if b |
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
import java.util.ArrayList; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Set; | |
public class Mutability { | |
public static void main(String[] args) { | |
ArrayList<String> l1 = new ArrayList<>(); |
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 2htdp/universe | |
2htdp/image) | |
(define snake-head-img | |
(overlay (triangle 8 'solid 'black) | |
(rectangle 10 10 'solid 'green))) | |
(define snake-body-img (rectangle 10 10 'solid 'green)) |
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
F# (as per http://fsharp.org/use/linux/): | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | |
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list | |
sudo apt-get update | |
sudo apt-get install mono-complete fsharp | |
VSCode: |
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 (read-string s) | |
(with-handlers | |
([(λ (_) #t) (λ (_) 0)]) | |
(define in (open-input-string s)) | |
(let loop () | |
(unless (eof-object? (read in)) | |
(loop))) | |
1)) |
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 (rename-out [my-read read] | |
[my-read-syntax read-syntax])) | |
(define (my-read in) (syntax->datum (my-read-syntax #f in))) | |
(define (rev stx) | |
(define l (syntax->list stx)) | |
(if l | |
(datum->syntax stx (reverse (map rev l)) stx stx) |
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
!cpu 6502 | |
!to "jump.prg",cbm | |
* = $0801 | |
!byte $0d,$08,$dc,$07,$9e,$20,$34,$39 | |
!byte $31,$35,$32,$00,$00,$00 | |
* = $c000 | |
ldx foo_addr |