Skip to content

Instantly share code, notes, and snippets.

View fogus's full-sized avatar
💭
attempting to learn how to better learn

Fogus fogus

💭
attempting to learn how to better learn
View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 9 columns, instead of 8 in line 8.
?,Year,Title,Author,Dialect,Publisher,Series,Links,Notes
,1989,Proceedings of the 1st annual workshop for the ACM sigForth,ACM,,ACM,,,
,1984,Function Forth For The BBC Computer,"Allan, Boris",,Sunshine Books,,https://www.jupiter-ace.co.uk/downloads/books/Functional_Forth_Boris_Allan.pdf][available online,
,1984,FORTH Tools. Vol.1,Anderson & Tracy,,,,,
,1981,"Forth-79, Version 2 (Apple-II)","Anderson, Anita & Tracy, Martin",-79,MicroMotion,,https://archive.org/details/forth79-A2/FORTH-79_A2Version_ReferenceManual/][available online,
,1982,FORTH Encycopedia - The complete FORTH Programmer's Manual,"Baker, Linda",,Mountain View Press,,,
,1984,Pocket Guide Forth,"Baker, Linda & Derick, Mitch",,Addison-Wesley,,,
,1983,"Easy Add-on Projects for Spectrum, ZX81 & Ace","Bishop, Owen",Spectrum FORTH,Bernard Babani,,https://www.jupiter-ace.co.uk/downloads/books/Easy_add-on_Projects_for_Spectrum_ZX81_and_ACE.pdf][available online,
,1984,Exploring Forth,"Bishop, Owen",-79 & fig-,Granada Technical Books,,https://www.jupite
@fogus
fogus / mvs.md
Last active August 14, 2024 14:27

Prior to discovering Clojure back in 2007, I was a full-time Java programmer. This was long before method handles, method references, lambda expressions, and invokedynamic, so viewing Java through a functional programming lens was not second-nature to me. Regardless, during my early Clojure explorations I fully expected code like the following to "just work":

(defn up-all [strings]
  (map .toUpperCase strings))
;; Unable to resolve symbol: .toUpperCase

That is, I[^cdevs] fully expected Clojure to recognize that .toUpperCase referred to the instance method String.toUpperCase as a value, and infer how to "do the right thing" with it for each element in the strings collection handled by map even though Clojure could never know what it might hold.

Of course, it eventually occurred to me that the actual way to do what I wanted was to wrap the method call in a function instead:

; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
(ns clojure.java.process
"A process invocation API wrapping the Java process API.

Clojure 1.12.0-alpha10

Clojure 1.12.0-alpha10 is now available! Please read the release notes below.

Clojure is a hosted language and fully embraces that host including the Java Virtual Machine, the JDK (Java Development Kit), and interop with Java APIs. Over the last decade, all of these have seen significant evolution and Java APIs are increasingly using recent Java features like streams, functional interfaces, and lambdas.

Clojure 1.12.0-alpha10 delivers significant enhancements to Java interop focusing on two main areas:

top games
Go
Hearts
Shogi
Haggis
Wabash Cannonball
Bridge
Uptown
Baseball Highlights 2045
ls
test$__STAR_.class
test$__STAR__STAR_.class
test$_main.class
test$loading__6798__auto____138.class
test__init.class
test$_init.class
test$fn__140.class
test.class
@fogus
fogus / verbose_proxy.c
Created January 17, 2024 21:56 — forked from lelanthran/verbose_proxy.c
A small program to proxy and record all traffic to a server.
/* ********************************************************
* Copyright ©2024 Rundata Systems. All rights reserved.
* This project is licensed under the GPLv3 License. You
* can find a copy of this license at:
* https://www.gnu.org/licenses/gpl-3.0.en.html
*
* More detail (1m read):
* https://www.rundata.co.za/rundata/products/verbose_proxy
*
* Example usage (3m video):
Hothouse by Aldiss
Other Days, Other Eyes by Shaw
City by Simak
Star of the Unborn by Werfel
Farewell Earth's Bliss by Compton
The Genocides by Disch
A Case of Conscience by Blish
Guernica Nights by Malzberg
We Who Are About To... by Russ
Solaris by Lem
// Copyright (C) 2023 dasshiva
#include <stdlib.h>
// Compiles on GCC 11.4.0 ubuntu idk about other systems
// Abusing macros to make C look a tiny bit better (maybe worse for some)
#define class(x, contents) typedef struct x x; struct x contents; // declare a class x
#define var(ty, name) ty name; // declare a variable
#define func(ty, x, ...) ty (*##x) (__VA_ARGS__); // declare a member function maybe static or non-static
#define static_func_def(ty, x, ...) ty x (__VA_ARGS__) // declare a static function
#define func_defnp(class, ty, x) ty x (class* self) // define a non-static function taking no parameters
@fogus
fogus / rereads.txt
Created September 13, 2023 14:13
rereads
A Gamut of Games
AEgypt trilogy
After Dark
Blood Meridian
Book of the New Sun
Chthon
Factory series
BORGES
Finite and Infinte Games
Flower Phantoms