Skip to content

Instantly share code, notes, and snippets.

View drewcrawford's full-sized avatar

Drew Crawford drewcrawford

View GitHub Profile

Keybase proof

I hereby claim:

  • I am drewcrawford on github.
  • I am drewcrawford (https://keybase.io/drewcrawford) on keybase.
  • I have a public key ASDx8wkT-3SVLIASexYQZMlenrGMUa9iVWMXzWkj67ePWgo

To claim this, I am signing this object:

/usr/bin/clang++ -ldl -lpthread -lbsd -licui18n -licuuc /swift-dev/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/linux/x86_64/swift_begin.o /tmp/test2-9cbb9a.o -L /swift-dev/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift_static/linux --target=x86_64-unknown-linux-gnu -Xlinker -rpath -Xlinker /swift-dev/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift_static/linux -lswiftCore @/tmp/test2-49baa1.autolink /swift-dev/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/linux/x86_64/swift_end.o -o test2
swift: /swift-dev/swift/include/swift/AST/Decl.h:2160: swift::Accessibility swift::ValueDecl::getFormalAccess() const: Assertion `hasAccessibility() && "accessibility not computed yet"' failed.
0 swift 0x00000000033bff78 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x00000000033be716 llvm::sys::RunSignalHandlers() + 54
2 swift 0x00000000033c0b7a
3 libpthread.so.0 0x00007efc6ef0b8d0
4 libc.so.6 0x00007efc6d8f0067 gsignal + 55
5 libc.so.6 0x00007efc6d8f1448 abort + 328
6 libc.so.6 0x00007efc6d8e9266
7 libc.so.6 0x00007efc6d8e9312
8 swift 0x0000000000ce19e7
@drewcrawford
drewcrawford / gist:6754526
Created September 29, 2013 17:23
Riddle of the day:
Riddle of the day:
* There are more than 10 different kinds
* They can be put together to make useful combinations
* Some are more common than others
./assembler/ARMAssembler.cpp:#if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL)
./assembler/ARMAssembler.cpp:#endif // ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL)
./assembler/ARMv7Assembler.cpp:#if ENABLE(ASSEMBLER) && CPU(ARM_THUMB2)
./assembler/LinkBuffer.cpp:#if CPU(ARM_THUMB2)
./assembler/LinkBuffer.cpp:#elif CPU(ARM_TRADITIONAL)
./assembler/MacroAssemblerARM.cpp:#if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL)
./assembler/MacroAssemblerARM.cpp:#if CPU(ARMV5_OR_LOWER)
./assembler/MacroAssemblerARM.cpp:#endif // ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL)
./assembler/MacroAssemblerSH4.cpp:#if ENABLE(ASSEMBLER) && CPU(SH4)
./dfg/DFGAssemblyHelpers.cpp:#if CPU(X86_64)
Binary files /Users/drew/Desktop/zmq_doesnt_work/__init__.pyc and /Users/drew/Desktop/zmq_that_works/__init__.pyc differ
Binary files /Users/drew/Desktop/zmq_doesnt_work/core/__init__.pyc and /Users/drew/Desktop/zmq_that_works/core/__init__.pyc differ
Binary files /Users/drew/Desktop/zmq_doesnt_work/core/_poll.so and /Users/drew/Desktop/zmq_that_works/core/_poll.so differ
Binary files /Users/drew/Desktop/zmq_doesnt_work/core/_version.so and /Users/drew/Desktop/zmq_that_works/core/_version.so differ
Binary files /Users/drew/Desktop/zmq_doesnt_work/core/constants.so and /Users/drew/Desktop/zmq_that_works/core/constants.so differ
Binary files /Users/drew/Desktop/zmq_doesnt_work/core/context.so and /Users/drew/Desktop/zmq_that_works/core/context.so differ
Binary files /Users/drew/Desktop/zmq_doesnt_work/core/device.so and /Users/drew/Desktop/zmq_that_works/core/device.so differ
Binary files /Users/drew/Desktop/zmq_doesnt_work/core/error.so and /Users/drew/Desktop/zmq_that_works/core/error.so differ
Binary files /
Sampling process 14623 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling terminal-notifier (pid 14623) every 1 millisecond
Process: terminal-notifier [14623]
Path: /Users/drew/Dropbox/Code/ConstructPM/develop-environment/terminal-notifier.app/Contents/MacOS/terminal-notifier
Load Address: 0x105e71000
Identifier: nl.superalloy.oss.terminal-notifier
Version: 1.4.207 (4e43c0)
Code Type: X86-64 (Native)
Parent Process: bash [12933]

This, is actually the wrong conclusion. The entire purpose of the “inner class” is to provide value semantics while maintaining effeciency of implementation.

Is that an opinion? Or was there a meeting when the "entire purpose" of inner classes was established and I wasn't invited? Sure, they can be used for efficiency, but they can also be used for other purposes, including inner mutation.

Just for starters, Mike Ash seems to have uncovered that inner classes are used inside the standard library to provide destructors:

Destruction can be solved by using a class, which provides deinit. The pointer can be destroyed there. class doesn't have value semantics, but we can solve this by using class for the implementation of the struct, and exposing the struct as the external interface to the array.

So to say that the "entire purpose" of inner classes is efficiency is I think plainly false; they are used for many reasons. E

GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 8 20:32:45 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".Attaching to process 4008.
2012-01-19 18:07:01.027 CLSpike[4008:13c03] starting performLaunchSetup
2012-01-19 18:07:01.026 CLSpike[4008:13703] starting performLaunchLogging
[info] 18:07:01 Application Launched! WPK_timestamp=2012-01-20 00:07:01 +0000 CLSAppDelegate.m:54
10:09:16 AM CST :  Please let our Representative know if you have contacted us by email regarding this same issue or question so that we may remove the duplicate request from our systems. Thank you!
 10:09:26 AM CST :  You are number (2) in queue.
 10:09:46 AM CST :  A Customer Service Representative will be with you as soon as one becomes available.
 10:10:17 AM CST :  Thank you for your patience.
 10:11:37 AM CST :  You are next in queue...