README: Fix typos

This commit is contained in:
Laria 2022-07-27 23:48:44 +02:00
parent b033983d52
commit e61caea2ff

View file

@ -33,7 +33,7 @@ apfl has these types of values:
- bool - Good ol' `true` and `false`
- numbers - Currently these are double-precision floats. This might be expanded to other numeric types.
- strings - Immutable byte string
- lists - A ordered list of values
- lists - An ordered list of values
- dictionaries - An unordered mapping from arbitrary keys to values
- functions - Can be called with values as arguments and returns a value
@ -238,7 +238,7 @@ Like a simple function, a complex function is written inside `{}` curly braces.
print (add10 1) # Prints 11
print (add10 32) # Prints 42
A function can contain multiple subfunctions, each with their own parameter list and their own body (everything after the parameter list up to the next parameter list or the eon of the function). When being called, the first subfunction, which parameter list matches the arguments ist getting evaluated This can for example be used to provide a default argument:
A function can contain multiple subfunctions, each with their own parameter list and their own body (everything after the parameter list up to the next parameter list or the end of the function). When being called, the first subfunction, which parameter list matches the arguments is getting evaluated. This can for example be used to provide a default argument:
hello := {
->
@ -251,7 +251,7 @@ A function can contain multiple subfunctions, each with their own parameter list
hello "Universe" # One argument, the second subfunction matches; prints "Hello, Universe"
hello "Foo" "Bar" # Two arguments, no subfunction matches; raises an error
A special variable name is `_`, it always matches but does not save the argument and can be used as a placeholder, if you don't care about the
A special variable name is `_`, it always matches but does not save the argument and can be used as a placeholder, if you don't care about the value.
A parameter can not only be a variable name, it can also be a constant value that the input is being matched against. As an example, here is a recursive definition of the factorial function: