ratfactor / ziglings

Learn the Zig programming language by fixing tiny broken programs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Explain abbreviation `lhs`

kai-tub opened this issue · comments

Hey,

I think it would be nice if the following code would also explain what lhs means:

// You'll need this builtin:
//
// @field(lhs: anytype, comptime field_name: []const u8)
//
// The first parameter is the value to be accessed,
// the second parameter is a string with the name of
// the field you wish to access. The value of the
// field is returned.

I haven't seen this abbreviation before, and now I know that it means "left-hand side," but I was not too sure as it seems weird to have a lhs without a rhs.
Especially if this notation is used multiple times inside of the Zig code base. :)

Maybe it could become:

[...] The first parameter (lhs = left-hand side)  is the value to be accessed [...]

Thanks!

PS: Loving Ziglings!