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
// An instance of an Objective C object gets wrapped: | |
define abstract class <objc/instance> (<object>) | |
constant slot raw-instance :: <machine-word>, | |
required-init-keyword: instance:; | |
constant each-subclass slot instance-objc-class :: <objc/class>; | |
end; | |
// However, we want them to be type safe and we want to | |
// to be able to dispatch on their arguments, so we will |
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
all: build | |
.PHONY: build test | |
LIB_SOURCES = $(wildcard *.dylan) \ | |
embed-dylan.lid | |
build: $(LIB_SOURCES) | |
mkdir -p _build/bin | |
dylan-compiler -build embed-dylan.lid |
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
Module: foo | |
Synopsis: | |
Author: | |
Copyright: See LICENSE file in this distribution. | |
define function text-parser (text :: <string>) => (text :: <string>) | |
text | |
end; | |
define function main (name :: <string>, arguments :: <vector>) |
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
Module: int | |
Synopsis: | |
Author: | |
Copyright: | |
define inline function exit(#key s :: one-of(#"a", #"b") = #"a") | |
let status = | |
if (s = #"a") | |
0 | |
elseif (s == #"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
batavia:sources bruce (master) $ ./main | |
batavia:sources bruce (master) $ echo $? | |
1 | |
batavia:sources bruce (master) $ ./main 2 3 4 | |
batavia:sources bruce (master) $ echo $? | |
4 | |
batavia:sources bruce (master) $ ls -alt main | |
-rwxr-xr-x 1 bruce staff 4312 Jan 28 15:33 main |
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
METHOD format-to-string (control-string :: <byte-string>, #next next-method, #rest args) => (result :: <byte-string>) | |
t10 := [METHOD-CALLi ^{<&method> make (singleton(<byte-string>))}(^{<&class> <byte-string>}, ^#[], ^' ', ^32)] | |
Vt15 := [STACK-VECTOR (^#"contents", t10, ^#"direction", ^#"output")] | |
*t15(1) := [CONGRUENT-CALLi ^{<&method> <byte-string-stream> constructor (<class>)}(^{<&class> <byte-string-stream>}, Vt15, ^#unbound-slot-value, ^{<&class> <object>}, ^#f, t10)] | |
t16 := *t15(1) [0] | |
[METHOD-CALLi ^{<&method> format (<stream>, <byte-string>)}(t16, {{ control-string }}, {{ args }})] | |
*t14(1) := [METHOD-CALLi ^{<&method> stream-contents (<sequence-stream>)}(t16, ^#[], ^#t)] | |
*t7(1) := multiple-value-check-type *t14(1) :: ^{<&class> <byte-string>} | |
return *t7(1) | |
END |
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 method factorial (n == 0) 1 end; | |
define method factorial (n == 1) 1 end; | |
define method factorial (n) | |
n * factorial(n - 1) | |
end; | |
format-out("%d", factorial(10)); |
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
libfib.dylib`KfibVfibI: | |
0x100003e40 <+0>: pushq %rbp | |
0x100003e41 <+1>: movq %rsp, %rbp | |
0x100003e44 <+4>: pushq %r14 | |
0x100003e46 <+6>: pushq %rbx | |
0x100003e47 <+7>: movq %rdi, %rbx | |
0x100003e4a <+10>: cmpq $0x9, %rbx | |
0x100003e4e <+14>: jl 0x100003e7b ; <+59> at fib.dylan:10 | |
0x100003e50 <+16>: movq %rbx, %rdi | |
0x100003e53 <+19>: subq $0x4, %rdi |
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
module: calvino-sdl2 | |
synopsis: bindings for the SDL2 library | |
author: Bruce Mitchener, Jr. | |
copyright: See LICENSE file in this distribution. | |
define constant <uint32-t> = <C-unsigned-int>; | |
define constant <Uint32> = <uint32-t>; | |
define inline C-function SDL-Init |
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
// a GenAvro file might look like: | |
// @namespace("wwm") | |
record timestamp { | |
long seconds; | |
long nanoseconds; | |
} | |
// @namespace("wwm") | |
record something { |
OlderNewer