AnyObject

When is AnyObject not AnyObject? When it’s a protocol type.

Run-time Polymorphism in Swift

This has come up several times on the forums over the years, but I’ve never written it up in a standard place, so here it is: There are only three ways to get run-time polymorphism in Swift. Well, three and a half.

GitMounter

A few days ago Julia Evans posted this:

has anyone made a read-only FUSE filesystem for a git repository where every commit is a folder and the folder contains all the files in that commit?

the idea is that you could just run cd COMMIT_ID and poke around instead of checking out the commit

and maybe the branches could be symbolic links to the commit folders?

And I did in fact do something very like that, back when I was playing with FUSE! But I never put it up anywhere cause it had an annoying build process, and didn’t seem to add much, and—

Older Posts

  1. 2023-10-04 There's No Such Thing As "Implicitly Atomic"
  2. 2023-01-22 Rescuing Files From Classic Mac OS...with Swift!
  3. 2022-11-28 The Two Faces of Codable/Serde
  4. 2022-10-09 Swift was always going to be part of the OS
  5. 2022-04-24 Default Arguments and Label-based Overloading
  6. 2022-03-02 UnsafeMutableRawBufferPointer
  7. 2021-12-31 Swift Regrets: Wrap-up
  8. 2021-12-30 Swift History: Assignment Methods
  9. 2021-12-28 Swift Regret: inout Syntax
  10. 2021-12-26 Swift Delight: Optional Conveniences
  11. 2021-12-23 Swift Regret: try?
  12. 2021-12-21 Swift Delight: try
  13. 2021-12-17 Swift Regret: Operator Function Lookup Rules
  14. 2021-12-15 Swift Regret: "Double" rather than "Float64"
  15. 2021-12-10 Swift Delight: Implicit Member Syntax
  16. 2021-12-08 Swift Regret: Weak Vars in Structs
  17. 2021-12-03 Swift Regret: Lazy Vars in Structs
  18. 2021-11-30 Swift Delight: No Unused Results
  19. 2021-11-24 Swift Regret: Open Protocols
  20. 2021-11-21 Swift Regret: Retroactive Conformances
  21. 2021-11-18 Swift Delight: Library Evolution
  22. 2021-11-10 Swift Mangling Regret: Private Discriminators
  23. 2021-11-05 Swift Mangling Regret: The "Old" Mangling
  24. 2021-11-03 Swift Mangling Regret: Library Evolution
  25. 2021-10-29 Swift Delight: #available
  26. 2021-10-22 Swift Regret: Implicitly-Hashable Payloadless Enums
  27. 2021-10-20 Swift Regret: Top-Level Decls in Script Mode
  28. 2021-10-15 Swift Delight: Names for Generic Parameters
  29. 2021-10-13 Swift Regret: Generic Parameters Aren't Members
  30. 2021-10-08 Swift Regret: OpaquePointer
  31. 2021-10-06 Swift Regret: Unannotated C Enums
  32. 2021-10-01 Swift Delight: Value Semantics Collections
  33. 2021-09-29 Swift Delight: guard
  34. 2021-09-24 Swift Regret: Inferred Property Types
  35. 2021-09-22 Swift Regret: Implicit Optional Initialization
  36. 2021-09-17 Swift Regret: Subscript Trailing Closures
  37. 2021-09-15 Swift Regret: Subscript Argument Label Rules
  38. 2021-09-10 Swift Regrets
  39. 2021-09-10 Swift Regret: Unapplied Instance Methods
  40. 2021-09-08 Swift Regret: Bound Methods
  41. 2021-08-29 Swift Regret: Type-based Overloading
  42. 2021-08-25 Swift Regret: AnyObject Dispatch
  43. 2021-08-20 Swift Regret: Labeled Tuple Elements
  44. 2021-08-18 Swift Regret: Tuples and Argument Lists
  45. 2021-08-13 Swift Regret: Sequence
  46. 2021-08-11 Swift Regret: mutating Protocol Methods vs. Classes
  47. 2021-08-06 Swift Regret: NSUInteger
  48. 2021-08-04 Swift Regret: Protocol Syntax
  49. 2020-10-20 The Swift Runtime: Enums
  50. 2020-10-06 The Swift Runtime: Class Metadata Initialization
  51. 2020-09-29 The Swift Runtime: Class Metadata
  52. 2020-09-21 The Swift Runtime: Uniquing Caches
  53. 2020-09-14 The Swift Runtime: Type Metadata
  54. 2020-09-07 The Swift Runtime: Type Layout
  55. 2020-08-31 The Swift Runtime: Heap Objects
  56. 2020-08-26 Objective-Rust
  57. 2020-07-07 Suffusion: Playing with Filesystems
  58. 2020-05-24 ROSE-8 on Mac OS 9
  59. 2020-04-01 Swift on Mac OS 9
  60. 2019-11-01 Leaving Apple
  61. 2019-02-21 A Shiny Magic Number
  62. 2018-04-03 "FIXME" Doesn't Always Mean "Fix Me"
  63. 2018-02-26 Many-to-Many Protocols
  64. 2017-09-07 The New Kingdom of Nouns

Possibly Related Tags