Functions - Steven-Hewitt/LI GitHub Wiki

2. List of functions

Each function noted here is one character, followed by the accepted parameters in parenthesis, followed by a dash - and its use. As this is a preliminary list, objects are subject to change.

I should note which of these are currently implemented: Those that are implemented have their explanations bolded.

  1. *...* - values (returns the values it was given as multiple arguments, in order to extend arity of certain functions)

  2. a (pair) - car (aka first)

  3. b (any*...) - build list

  4. c (any any) - cons

  5. C (int) - cast to character

  6. C (list) - Combination of 2 (in order)

  7. d (pair) - cdr (aka rest)

  8. d (int) - digits (returns list of single numbers)

  9. D (list) - duplicate (mλh*chhi)

  10. e (string any) - eval w/ input (explicit string literal/expression needed)

  11. E (string) - eval (implicit i as input)

  12. f (list) - flatten

  13. f (number) - floor (casts to int)

  14. F (func list*...) - foldl

  15. g (func) - force execution (executes the function with its arguments even when the function literal would have been returned)

  16. G (func) - force function literal

  17. h (int) - halve

  18. i - input variable (implicitly fills end of string if extra parameters are needed)

  19. I (list) - condense (returns a number that contains the numbers from the list's digits in the same order)

  20. j - returns the input variable for implicit inner lambdas

  21. l () - empty list

  22. L (i*func)- lambda

  23. m (func list*...) - map

  24. M (number number*...) - multiply

  25. M (list list) - Cartesian product (list of lists)

  26. M (list number) - Repetition

  27. n (number) - random number between 0 and argument (float)

  28. N (int) - random integer between 0 and argument

  29. p (int) - primality (returns boolean)

  30. P (any) - print-return (as p in Pyth)

  31. q () - quine (returns the source code for the top-level λ)

  32. r (string string) - regex match (returns truthy regresult if matched, or false if not)

  33. r (list int) - value at int position in list (because of implicit casting, works for strings as well)

  34. R (any*...) - recurse (call current lambda function with these parameters. If more than one argument, implicit build-list the arguments.)

  35. s (list func*func) - sort (list sorted by func which takes two arguments and outputs truthy falsy value, may have two functions in which case the second one outputs a key to use)

  36. S (string string) - split arg2 on arg1

  37. T () - current time (as a list of year, month, day, hours, minutes, seconds)

  38. u (*...) - null (always returns no value and is equal to no value)

  39. U (list any) - search (returns first list index that contains the second parameter or boolean "False")

  40. V (number) - Variations of "Hello World"

  41. w (number) - wait argument milliseconds

  42. W () - current weekday (integer from 0 to 6)

  43. X (int) - range (0 to int - 1)

  44. y (number) - decrement

  45. Y (number) - increment

  46. z (sequence integer) - first integer values from the given sequence

  47. + (number number*...) - sum

  48. + (list list*...) - append

  49. . (any) - duplicate (.x is equivalent to *xx*)

  50. : (any) - triplicate (:x is equivalent to *xxx*)

  51. , (list) - params from list

  52. - (number number*...) - difference

  53. _ (boolean) - negate*

  54. _ (list) - empty?

  55. _ (number) - zero?

  56. = (any any) - equal?

  57. / (number number*...) - divide

  58. / (list list) - intersection

  59. / (number list) - n-step

  60. % (number number) - modulus

  61. ^ (number number) - power

  62. & (bool bool*...) - and

  63. | (bool bool*...) - or

  64. $ (regresult string) - regex replace (returns original string if regresult is falsy)

  65. # (list) - length

  66. ! (integer) - factorial

  67. ! (list (of list)) - transpose

  68. [ (list*...) - any

  69. ] (list*...) - all

  70. { (any list*...) - in

  71. } (any list*...) - not in

  72. > (number number) - greater than

  73. > (string string) - greater than (length, then character-by-character)

  74. > (number string) - greater than (implicit length)

  75. < (number number) - lesser than

  76. < (string string) - lesser than (length, then character-by-character)

  77. < (number string) - lesser than (implicit length)

  78. ) (func list (of list)*...) - maximum-map-from-list

  79. ( (func list (of list)*...) - minimum-map-from-list

  80. ~ (list) - reverse

  81. ~ (int) - invert (equivalent to -0)

  82. \ (*) - character literal

  83. "..." - string literal (" for double quotes inside strings and other escape sequences are as usual. Implicitly ends string if needed)

  84. '...' - number literal (longer than one digit)

  85. ? (boolean any any) - if-else

  86. @ (any any) - if-else with implied input as boolean.

  87. 0 (...) - always returns 0

  88. 1 (...) - always returns 1

  89. 2 (...) - always returns 2

  90. 3 (...) - always returns 3

  91. 4 (...) - always returns 4

  92. 5 (...) - always returns 5

  93. 6 (...) - always returns 6

  94. 7 (...) - always returns 7

  95. 8 (...) - always returns 8

  96. 9 (...) - always returns 9