Skip to content

Instantly share code, notes, and snippets.

View pedro-w's full-sized avatar
💭
reasonable

Peter Hull pedro-w

💭
reasonable
View GitHub Profile
// This outputs a/
define function one ()
let a = as (<directory-locator>, "a/");
let b = as (<file-locator>, "b");
let c = merge-locators(a, b);
format-out("%s\n", as(<string>, c));
end;

Instructions for building dylan on macOS 10.13

Introduction

This is a bit tricky because

  1. opendylan-2013.2 (the latest binary for macOS) can't compile a 64-bit dylan
  2. Neither can the 2014.1 source release
  3. The Boehm garbage collector (a required dependency) is no longer available
@pedro-w
pedro-w / error.txt
Created April 9, 2018 10:34
Lein Windows Security Error
>lein self-install
Downloading Leiningen now...
Exception calling "DownloadFile" with "2" argument(s): "The request was
aborted: Could not create SSL/TLS secure channel."
At line:1 char:145
+ ... che]::DefaultNetworkCredentials; $client.DownloadFile($a, $f)} "https ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
@pedro-w
pedro-w / file.markdown
Last active March 19, 2018 07:39
Dylan file stream

file-reader.dylan

Module: file-reader
Synopsis: 
Author: 
Copyright: 

define function main
@pedro-w
pedro-w / intable.dfm
Last active January 11, 2018 13:31
Strange dylan compile warnings
METHOD test-no-warnings () => ()
[CONGRUENT-CALLi ^{<&method> h? ()}()]
*t8(0) := [VALUES]
return *t8(0)
END
METHOD h? () => (#rest results)
*t1(1) := [VALUES ^#f]
return *t1(1)
END
@pedro-w
pedro-w / osx.diff
Created January 3, 2018 07:32
The root cause
diff --git a/sources/registry/x86_64-darwin/dood b/sources/registry/x86_64-darwin/dood
index 466a24e0..65432a09 100644
--- a/sources/registry/x86_64-darwin/dood
+++ b/sources/registry/x86_64-darwin/dood
@@ -1 +1 @@
-abstract://dylan/lib/dood/dood.lid
+abstract://dylan/lib/dood/dood-64.lid
@pedro-w
pedro-w / gist:15b853e861500bbbb326909e5bfeda21
Created December 15, 2017 14:24
This one stupid trick
diff --git a/sources/dfmc/modeling/machine-word-primitives.dylan b/sources/dfmc/modeling/machine-word-primitives.dylan
index 54d47432..e2e26c0d 100644
--- a/sources/dfmc/modeling/machine-word-primitives.dylan
+++ b/sources/dfmc/modeling/machine-word-primitives.dylan
@@ -86,7 +86,7 @@ define custom &machine-word-primitive primitive-cast-raw-as-integer
(x :: <raw-machine-word>) => (result :: <integer>)
// Signals an error if the result is too big to be an <integer> ...
let x :: <abstract-integer> = extract-mw-operand-unsigned(x);
- as(<integer>, generic/lsh(x, -2))
+ as(<integer>, generic/ash(x, -2))
@pedro-w
pedro-w / info.md
Last active June 14, 2017 09:29
Help needed with lifetime error

Summary

In Rust SDL2 I need to create a texture. The way to do this is to get a TextureCreator from a Window and then use TextureCreator to create the textures. The TextureCreator lives independently from its Window. However the Texture must not outlive the TextureCreator. I don't know how to encapsulate this in a struct so that the compiler knows that.

The code in main.rs gives error [E0597]