Avatar
omochimetaru 4/22/2025 8:23 AM
Contribute to apple/swift-play-experimental development by creating an account on GitHub.
8:24 AM
$ cat Sources/Fibonacci/Fibonacci.swift func fibonacci(_ n: Int) -> Int { ... } import Playgrounds #Playground("Fibonacci") { for n in 0..<10 { print("fibonacci(\(n)) = \(fibonacci(n))") } } こういうのを書いておくと
8:24 AM
$ swift play --list Building for debugging... Found 1 Playground * Fibonacci/Fibonacci.swift:23 "Fibonacci" $ swift play Fibonacci Building for debugging... ---- Running Playground "Fibonacci" - Hit ^C to quit ---- Fibonacci(7) = 21 ^C
8:25 AM
こういう感じで、シンボルがある状況でreplできるらしい
👀 3
8:25 AM
swiftpm側にも手が入ってるそうな
8:25 AM
ライブラリを簡単に試せるようにするものかな?