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
@pedro-w
pedro-w / if-let-with-parens.dylan
Last active June 14, 2021 18:35
if-let for Dylan
Module: iflet
Synopsis:
Author:
Copyright:
define macro if-let
{ if-let (?:name = ?:expression) ?b1:body else ?b2:body end }
=> { let ?name = ?expression;
if(?name) ?b1 else ?b2 end }
{ if-let (?:name = ?:expression) ?:body end }
@pedro-w
pedro-w / .txt
Last active June 8, 2021 21:44
Some screenshots for LSP
See image
@pedro-w
pedro-w / .markdown
Last active December 19, 2020 13:06
Instructions for setting up Allegro / Visual Studio

Prerequisites

  • Visual Studio 2019
  • C/C++ workload for VS (includes SDK and CMake)
  • Allegro 5.2.6 source code from GitHub

Configure

  • Unzip allegro somewhere
  • Start a "x64 Native Command Tools" prompt
  • Navigate to allegro root dir
  • Configure for debugging cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug
@pedro-w
pedro-w / timer.c
Created December 7, 2020 16:34
Experiment with Waitable Timer
#include <Windows.h>
#include <iostream>
std::ostream& printnow() {
static ULONGLONG initial = 0;
if (initial == 0) {
initial = GetTickCount64();
return std::cout << 0 << '\t';
}
else {
@pedro-w
pedro-w / tasks.json
Created November 10, 2020 21:21
Problem matcher for Dylan & VSCode
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "compile dylan",
"type": "shell",
"command": "dylan-compiler -build ${workspaceFolderBasename}",
"problemMatcher": [
@pedro-w
pedro-w / .c
Created August 12, 2020 11:39
float compare in C
#include <math.h>
#include <stdio.h>
struct v3d {
float x, y, z;
};
struct v3d make(float x, float y, float z) {
struct v3d ans;
ans.x = x;
@pedro-w
pedro-w / backtrace
Created July 9, 2020 20:51
example backtrace
(lldb) dylan-bt -a
frame #0 [primitive_invoke_debugger] 0x000001001baa71 libdylan.dylib at x86_64-darwin-runtime.ll:0
frame #1 [Kinvoke_debuggerVKiMM1] 0x00000100151439 libdylan.dylib at boot.dylan:1041
frame #2 [general_engine_node_n] 0x000001001d838d libdylan.dylib
frame #3 [Kdefault_handlerVKdMM1] 0x000001001617e2 libdylan.dylib at condition.dylan:140
frame #4 [general_engine_node_n] 0x000001001d838d libdylan.dylib
frame #5 [Kdefault_last_handlerYcommon_dylan_internalsVcommon_dylanMM0] 0x000001000e7818 libcommon-dylan.dylib at common-extensions.dylan:448
frame #6 [general_engine_node_n] 0x000001001d838d libdylan.dylib
frame #7 [KerrorVKdMM0] 0x000001001613a6 libdylan.dylib at condition.dylan:125
frame #8
(lldb) dylan-bt -a
frame #0 [primitive_invoke_debugger] 0x000001001baa71 libdylan.dylib at x86_64-darwin-runtime.ll:0
frame #1 Kinvoke_debuggerVKiMM1 0x00000100151439 libdylan.dylib at boot.dylan:1041
frame #2 [general_engine_node_n] 0x000001001d838d libdylan.dylib
frame #3 Kdefault_handlerVKdMM1 0x000001001617e2 libdylan.dylib at condition.dylan:140
frame #4 [general_engine_node_n] 0x000001001d838d libdylan.dylib
frame #5 Kdefault_last_handlerYcommon_dylan_internalsVcommon_dylanMM0 0x000001000e7818 libcommon-dylan.dylib at common-extensions.dylan:448
frame #6 [general_engine_node_n] 0x000001001d838d libdylan.dylib
frame #7 KerrorVKdMM0 0x000001001613a6 libdylan.dylib at condition.dylan:125
frame #8 Kn
[Trace - 10:46:06 am] Sending request 'textDocument/definition - (2)'.
Params: {
"textDocument": {
"uri": "file:///home/peter/Projects/lsp-dylan/testproject/testproject.dylan"
},
"position": {
"line": 18,
"character": 11
}
}
@pedro-w
pedro-w / error.txt
Created June 29, 2020 21:06
Splitting code across modules
No applicable method, applying {<incremental-generic-function>: table-protocol} to {<simple-object-vector>: {<no-table>}}.
No applicable method, applying {function 0x7fed119e7700} to #[{<no-table> 0x55bc735e4840}].
Breaking into debugger.
Backtrace:
raise + 0x10b
invoke-debugger:internal:dylan##1 + 0x49
default-handler:dylan:dylan##1 + 0x2a
default-last-handler:common-dylan-internals:common-dylan##0 + 0x104
error:dylan:dylan##0 + 0x54
no-applicable-method-error:dylan-extensions:dylan + 0x4d8