Embedded programming language for Zig
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor documentation improvement

IamPyu 0fdd2edb 7fa0b2bf

+6 -1
+6 -1
src/lang.zig
··· 1 1 const std = @import("std"); 2 - 3 2 const Allocator = std.mem.Allocator; 4 3 const Arena = std.heap.ArenaAllocator; 5 4 ··· 146 145 return atom; 147 146 } 148 147 148 + /// Initialize a value from a raw value 149 149 pub fn initFrom(scope: *Scope, value: Self) RuntimeError!*Self { 150 150 const val = try Self.initNil(scope); 151 151 val.* = value; ··· 153 153 } 154 154 155 155 /// Initialize from any supported type 156 + /// 157 + /// - `i32`, `i64`, `u32`, `u64`, `f32`, `f64` and comptime numbers initializes a number. 158 + /// - `void` initializes a `nil` value. 159 + /// - `bool` initializes a `bool` value. 160 + /// - `*Value` creates a quoted value. 156 161 pub fn initFromAny(scope: *Scope, value: anytype) RuntimeError!*Self { 157 162 return switch (@TypeOf(value)) { 158 163 void => Self.initNil(scope),