- Proposal: SE-NNNN
- Authors: Marc Rasi, Chris Lattner
- Review Manager: TBD
- Status: Awaiting implementation
Swift-evolution thread: https://forums.swift.org/t/pitch-compile-time-constant-expressions-for-swift/12879
import AtpAgent from '@atproto/api' | |
import { Secp256k1Keypair } from '@atproto/crypto' | |
import * as ui8 from 'uint8arrays' | |
const OLD_PDS_URL = 'https://bsky.social' | |
const NEW_PDS_URL = 'https://pds.haileyok.com' | |
const CURRENT_HANDLE = 'haileyok.com' | |
const CURRENT_PASSWORD = '' | |
const NEW_HANDLE = 'newphone.pds.haileyok.com' | |
const NEW_ACCOUNT_EMAIL = '' |
import SwiftUI | |
enum OSDocumentError: Error { | |
case unknownFileFormat | |
} | |
#if canImport(UIKit) | |
import UIKit |
// | |
// A Swift property wrapper for adding "indirect" to struct properties. | |
// Enum supports this out of the box, but for some reason struct doesn't. | |
// | |
// This is useful when you want to do something recursive with structs like: | |
// | |
// struct Node { | |
// var next: Node? | |
// } | |
// |
extension Color { | |
/// Return a random color | |
static var random: Color { | |
return Color( | |
red: .random(in: 0...1), | |
green: .random(in: 0...1), | |
blue: .random(in: 0...1) | |
) | |
} | |
} |
''' | |
parse SavedState artifacts extracted from OSX. | |
author: Willi Ballenthin ([email protected]) | |
license: Apache 2.0 | |
''' | |
import re | |
import sys | |
import json | |
import struct |
import Foundation | |
protocol TransformerType { | |
associatedtype Object | |
associatedtype JSON | |
func transformFromJSON(_ value: Any) throws -> Object | |
func transformToJSON(_ value: Object) throws -> JSON | |
} |
Swift-evolution thread: https://forums.swift.org/t/pitch-compile-time-constant-expressions-for-swift/12879
import AppKit | |
extension NSImage { | |
/// Copies this image to a new one with a circular mask. | |
func oval() -> NSImage { | |
let image = NSImage(size: size) | |
image.lockFocus() | |
NSGraphicsContext.current?.imageInterpolation = .high |
Most of the manifesto is background and detailed definitions -- if you're confused or want details, read the manifesto!
https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170213/032155.html
Note also that manifestos aren't complete proposals -- syntax and details may change!
One piece of background: inout
is kinda complicated because it can be used on computed properties -- foo(&val.x)
might be sugar for