Skip to content

Instantly share code, notes, and snippets.

@burakemir
burakemir / example.test.rkt
Created September 25, 2021 19:02
Silly example to demonstrate evaluating at compile-time and runtime
#lang reader "test-lang-reader.rkt"
(+ 1 2)
@burakemir
burakemir / events.csv
Last active March 28, 2021 10:42
Typed Racket adaptation of Push-model SQL interpreter
YEAR DESCRIPTION
1968 Elefants Druk and Chukha arrive in Zurich Zoo
1976 Snow leopards move to a new area
1979 Zoo Zurich has 21 millionth visitor
1979 on occasion of 50th anniversary entry fee reduced to 1 CHF
1985 first PC installed
@burakemir
burakemir / main.dart
Created February 26, 2021 20:55
What happens when you're missing variance
class Foo {}
class Bar extends Foo {}
void main() {
Map<String, Foo> m = {};
Map<String, Bar> n = {};
m = n;
m["a"] = Foo();
// Uncaught Error: TypeError: Instance of 'Foo': type 'Foo' is not a subtype of type 'Bar'
}
@burakemir
burakemir / main.dart
Created December 8, 2020 09:38
null safety
class Foo {
covariant double? _zoo = 3.14;
set zoo(covariant double? o) {_zoo = o;}
double? get zoo => _zoo;
}
class Bar extends Foo {
@override double _zoo = 2.3;
@override set zoo(double o) {_zoo = o;}