Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
/* ******************************************************** | |
* 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): |
// 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 |
;; Big thanks to Christophe Grand - https://groups.google.com/d/msg/clojure/L1GiqSyQVVg/m-WJogaqU8sJ | |
(defn scaffold [iface] | |
(doseq [[iface methods] (->> iface .getMethods | |
(map #(vector (.getName (.getDeclaringClass %)) | |
(symbol (.getName %)) | |
(count (.getParameterTypes %)))) | |
(group-by first))] | |
(println (str " " iface)) | |
(doseq [[_ name argcount] methods] | |
(println |
(defmacro return% [a] | |
`(fn return-fn# [success# error#] | |
#(try | |
(success# ~a) | |
(catch Throwable t# | |
(error# t#))))) | |
(defn bind% [m b] | |
(fn a [success error] | |
#(m (fn x [value] ((b value) success error)) error))) |
Object>>chain | |
^ ChainProxy new setTarget: self | |
ChainProxy>>doesNotUnderstand: aMessage | |
target := aMessage sendTo: target. | |
^ target | |
ChainProxy>>setTarget: anObject | |
target := anObject. | |
^ self |
; source https://github.com/woodrush/sectorlisp-examples/blob/main/lisp/basic.lisp | |
; Common Lisp translation: joswig@lisp.de, 2022 | |
; https://gist.github.com/lispm/a2f56a1a6dc5599a039eb7134d99cd4a | |
(defun basic-example () | |
(BASICINTERPRETER | |
(QUOTE ( | |
(10 REM FIND AND PRINT PRIME NUMBERS BELOW N_MAX. ) | |
(20 LET N_MAX = (1 1 1 1 1 1 1 1 1 1 1 1 1 1 1) ) | |
(30 LET I = (1 1) ) |
CFLAGS=-std=c99 -pedantic -Wall -Werror | |
.PHONY: run forth | |
run: forth | |
./forth test.fs | |
forth: forth.c | |
$(CC) $(CFLAGS) -o forth forth.c |
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
FILE *in; long M[1<<24]={0}, *D, *R, H=0x130000, IP=0, T; | |
long getu() { long t, h = getc(in); if (h < 0xC0) return h; | |
t = ((h&0x1F) << 6) | (getc(in) & 0x3F); if (h < 0xE0) return t; | |
t = ( t << 6) | (getc(in) & 0x3F); if (h < 0xF0) return t; | |
t = ( t << 6) | (getc(in) & 0x3F); return t & 0x1FFFFF; } | |
void putu(long c) { if (c < 0x80) { putchar(c); return; } | |
if (c < 0x7FF) { putchar(0xC0|(c>>6)); } else { |