❮ Add
❯
Add in function
examples/python-types-at-pyweb-2025-01/function.rs
fn add(x: u32, y: u32) -> u32 { x + y } fn main() { println!("ok"); let first = "19"; let second = 23; println!("{}", add(first, second)); }
examples/python-types-at-pyweb-2025-01/function.py
def add(x, y): return x + y print("ok") first = "19" second = 23 print(add(first, second))
examples/python-types-at-pyweb-2025-01/function.pl
use feature 'say'; sub add { my ($x, $y) = @_; $x + $y } say "ok"; my $first = "19"; my $second = 23; say add($first, $second);
Much less obvious if we are calling a function with parameters that are not the correct type.
The result is the same as in the previous example.