#Why the rename

1 messages · Page 1 of 1 (latest)

dense meadow
#

What's the reason why zig go from @intToFloat to @floatFromInt ?

outer grail
#

it used to be the case that casting builtins would take as a first parameter the destination type, and the second parameter would be the source value

#

now, builtins only take the source value, and infer the desitination type based on the result location

#
const old_syntax = @intToFloat(f32, value);
const new_syntax: f32 = @floatFromInt(value);
#

the rename part is mostly because of this semantic change

grave cipher
#

well the names got changed before the RLS stuff

outer grail
#

yes, but the rename is explicitly because of the RLS stuff

grave cipher
#

oh i didnt realize that

dense meadow
#

Thanks !

grave cipher
#

thought it was just because it was kinda more clear, everything that returns an int starts with int, results goes to the thing on the left so the result name is on the left etc

outer grail
#

it reads better, because now it's not "int to float, f32, value". Instead it's "f32 float from int, value"