From e61caea2ffddda1911bef580e08a2a7869d59eed Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Wed, 27 Jul 2022 23:48:44 +0200 Subject: [PATCH] README: Fix typos --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3f7a6f1..627aab7 100644 --- a/README.md +++ b/README.md @@ -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: