This question already has an answer here:
I want to write a function using string as explanation for its arguments so that the function becomes intuitive for new users. For example, I want to write a function to compute BMI (just for illustration, not the real problem):
bmi[h_, w_] := (703*w)/(12*h)^2 bmi[5.4, 142]
I can modify this function as the following and it works but assigns values.
bmi2[heightinFeet = h_, weightinLB = w_] := (703*w)/(12*h)^2 bmi2[5.4, 142] == bmi2[heightinFeet = 5.4, weightinLB = 142] bmi2[heightinFeet = 5.4, weightinLB = 142] heightinFeet
But I want to define the function with explanation of the arguments without assignment. That is, I want to modify this function as follows and not assign values:
bmi3["height in Feet" = h_, "weight in LB" = w_] := (703*w)/(12*h)^2 bmi3[5.4, 142]
bmi3 might work but not sure how this assignment is working. Is there a better way to address this issue?