Skip to content

Instantly share code, notes, and snippets.

#pragma once
#include <memory>
#include <functional>
#include <exception>
/* Since shared_ptr may always be nullptr, optional<shared_ptr<T>> makes no sense, that's what it already is.
But that means we need a non-nullable version of shared_ptr. This file is it.
Prerequisites: 1. Can't be assigned a null value (like an un-checked shared_ptr)
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active July 5, 2025 17:24
Hyperlinks in Terminal Emulators
@landonf
landonf / strongtalk.md
Last active August 3, 2024 13:30
A brief list of Strongtalk papers

In considering where Objective-C could go, it's worthwhile to start by understanding the work that's already been done.

Below are a selection of papers from Gilad Bracha's 1990s work on Strongtalk, an extension of Smalltalk (from which Objective-C's design derives) with (among other things), stronger type-safety tooling.

What's interesting (to me, anyway), is that the work done on the Self/Strongtalk VM in the early 90s was actually bought by Sun and became the modern Java VM. When Google got started on their V8 JavaScript runtime, guess who shows up again — Lars Bak, who was the technical lead for both the Strongtalk and HotSpot Java VMs.

If we're going to be talking about how to apply "modern" (1990s!) ideas to Objective-C, we'd be wise to review the considerable work done in considering those sorts of problems in a Smalltalk-derived universe, and lifting whatever good ideas we can, and discarding

@monkeydom
monkeydom / CompareMacro.h
Created August 24, 2011 10:33
Objective-C Compare Macro for your convenience
#if !defined(COMPARE)
#define COMPARE(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? NSOrderedAscending : (__a > __b ? NSOrderedDescending : NSOrderedSame); })
#endif