This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 2024 Yoshimasa Niwa | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 6ac1a2feb7143a8bc0e57af5c8dc57cbbb05d85f | |
Author: Yoshimasa Niwa <niw@niw.at> | |
Date: Fri Apr 19 22:14:55 2024 -0700 | |
wip | |
diff --git a/3_bidirectional_cxx_interop/include/fibonacci/fibonacci.h b/3_bidirectional_cxx_interop/include/fibonacci/fibonacci.h | |
index 911e7d7..ed3f909 100644 | |
--- a/3_bidirectional_cxx_interop/include/fibonacci/fibonacci.h | |
+++ b/3_bidirectional_cxx_interop/include/fibonacci/fibonacci.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AppKit | |
import Foundation | |
final class MainView: NSView { | |
private let textView: NSTextView | |
override init(frame frameRect: NSRect) { | |
textView = NSTextView(usingTextLayoutManager: true) | |
super.init(frame: frameRect) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage | |
# ===== | |
# | |
# ## Prerequisite | |
# | |
# Prepare Python 3, for exmaple, install Homebrew and `brew install python`. | |
# | |
# ## Install dependencies | |
# | |
# $ python3 -m venv .venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension String: Error {} | |
// MARK: - Parser Combinator | |
typealias ParserFunction<Element, Output> = | |
(any Collection<Element>) throws -> (Output, any Collection<Element>) | |
protocol Parser<Element, Output> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension String: Error {} | |
// MARK: - Evaluation | |
enum Atom { | |
case symbol(String) | |
case number(Double) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import AppKit; | |
@import Foundation; | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
@try { | |
if (argc < 2) { | |
printf("Usage: %s [visual format for a 'view']\n", argv[0]); | |
return 0; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// With Swift 5.8, it crashes on runtime due to reference count problem. | |
// With Swift 5.9-dev (LLVM d59f7189924eff9, Swift 12f2c2eb92c4c6a), today's nightly, it crashes due to an assertion. | |
class Box<T> { | |
private var value: T | |
init(_ value: T) { | |
self.value = value | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Version</key> | |
<integer>2</integer> | |
<key>Actuator_1</key> | |
<array> | |
<dict> | |
<key>ActuationID</key> |
NewerOlder