Bindings
Ferret has three common binding forms:
letimmutable local bindinglet mutmutable local bindingconstcompile-time constant
let and let mut
Section titled “let and let mut”let language = "Ferret"let mut retries = 0retries = retries + 1Type annotations use : when needed:
let code: i32 = 200let mut total: i64 = 0const is for values that are fixed at compile time.
const MAX_CONNECTIONS = 128const APP_NAME = "ferret-docs"Mutability On Parameters
Section titled “Mutability On Parameters”fn bump(mut x: i32) -> i32 { x = x + 1 return x}mut on a parameter controls the local parameter binding in that function.