Editing this Documentation
Information Architecture
Section titled “Information Architecture”How-to guides
Section titled “How-to guides”Guides lead a user through a specific task they want to accomplish, often with a sequence of steps. Writing a good guide requires thinking about what your users are trying to do.
Further reading: how-to guides in the Diátaxis framework
Reference Pages
Section titled “Reference Pages”Reference pages are ideal for outlining how things work in terse and clear terms. Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you’re documenting.
Further reading: reference pages in the Diátaxis framework
Regular snippet
Section titled “Regular snippet”public fun main() { print("Hello, World!")}With title
Section titled “With title”public fun main() { print("Hello, World!")}No frame:
echo "Command without frame"With frame (default):
echo "This terminal frame has no title"With title:
Write-Output "This one has a title!"Word wrap
Section titled “Word wrap”No wrapping (default):
cmake -D LLVM_DIR=<LLVM>/lib/cmake/llvm -D CMAKE_BUILD_TYPE=<build-type> -D BUILD_TESTING=1 -G Ninja -S . -B .buildWrap:
cmake -D LLVM_DIR=<LLVM>/lib/cmake/llvm -D CMAKE_BUILD_TYPE=<build-type> -D BUILD_TESTING=1 -G Ninja -S . -B .buildHanging indent:
cmake -D LLVM_DIR=<LLVM>/lib/cmake/llvm -D CMAKE_BUILD_TYPE=<build-type> -D BUILD_TESTING=1 -G Ninja -S . -B .buildHighlights
Section titled “Highlights”internal type SpawnFrame<E: Movable & Deinitializable>: Deinitializable {
/// The base frame object needed by the underlying implementation. private var base_frame: SpawnFrameBase
/// What needs to be called to produce the value in the future. private var f: [E]() -> Int
/// The result of the computation. private var r: Optional<Int>
/// Initializes `self` with `f`, and spawns the computation. internal init(_ f: sink [E]() -> Int) { &self.base_frame = .new() &self.f = f &self.r = .none()
let local_f = fun (_ frame: inout SpawnFrameBase) -> Void { var this = PointerToMutable<Self>(type_punning: mutable_pointer[to: &frame]) &this.unsafe[].r = this.unsafe[].f() as _ } concore2full_spawn2(&self.base_frame, local_f) }
/// Awaits the result of the computation. /// /// - Note: May return on a different OS thread than the one that called this. internal fun await() inout -> Int { concore2full_await(self.base_frame) if let r: Int = self.r { let copy = r.copy() &self.r = .none() return copy } else { fatal_error() } }
/// Allocate an object of `Self` on the heap and initialize it with `f`. internal static fun allocate(_ f: sink [E]() -> Int) -> PointerToMutable<Self> { let p: PointerToMutable<Self> = .allocate(count: 1) Self.`init`(self: &p.unsafe[], f) return p }
}Squiggles
Section titled “Squiggles”public fun main() { let gravity = 9.81 &gravity = 11.2 }Folder Structure
Section titled “Folder Structure”DirectorySources
DirectoryHello
- Hello.hylo
DirectoryGreetings
- Greetings.hylo