Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Back to post

Revisions 2

10 months ago
What determines purity in FunC? Read/Write Functions
What determines purity in FunC? Read/Write Functions
In the context of the FunC language, the three options define the concept of a pure function. A pure function is a function that: A) **Only reads the values passed** to it as parameters and does not access any external state. This means that its output is solely determined by its input parameters. B) **Can read values outside of the function parameters, but its output still depends only on the values passed to it as parameters.** It does not rely on any external state or global data. C) Can **read values outside of the function parameters**, but its output must be independent of any global data. This means that it should not use or depend on any global variables or data. These definitions of a pure function help ensure that a function's output is predictable and consistent, making it easier to understand, test, and debug. --- Practically: a) ""impure"" modifier present - guarantees correct behaviour b) ""impure"" modifier absent - FunC compiler will do strange things, such as strip out some code without your permission. It will silently remove the function call in two cases: a) function returns nothing: () fun() { } b) function returns something, but this something is not assigned to anything: ``` (int) fun() { return 5; } ... int a = fun(); ;; fun is called fun(); ;; fun call is removed" ```
In the context of the FunC language, the three options define the concept of a pure function. A pure function is a function that: A) **Only reads the values passed** to it as parameters and does not access any external state. This means that its output is solely determined by its input parameters. B) **Can read values outside of the function parameters, but its output still depends only on the values passed to it as parameters.** It does not rely on any external state or global data. C) Can **read values outside of the function parameters**, but its output must be independent of any global data. This means that it should not use or depend on any global variables or data. These definitions of a pure function help ensure that a function's output is predictable and consistent, making it easier to understand, test, and debug. Practically: a) ""impure"" modifier present - guarantees correct behaviour b) ""impure"" modifier absent - FunC compiler will do strange things, such as strip out some code without your permission. It will silently remove the function call in two cases: a) function returns nothing: () fun() { } b) function returns something, but this something is not assigned to anything: ``` (int) fun() { return 5; } ... int a = fun(); ;; fun is called fun(); ;; fun call is removed" ```
10 months ago
Original
What determines purity in FunC? Read/Write Functions

In the context of the FunC language, the three options define the concept of a pure function. A pure function is a function that: A) **Only reads the values passed** to it as parameters and does not access any external state. This means that its output is solely determined by its input parameters. B) **Can read values outside of the function parameters, but its output still depends only on the values passed to it as parameters.** It does not rely on any external state or global data. C) Can **read values outside of the function parameters**, but its output must be independent of any global data. This means that it should not use or depend on any global variables or data. These definitions of a pure function help ensure that a function's output is predictable and consistent, making it easier to understand, test, and debug. Practically: a) ""impure"" modifier present - guarantees correct behaviour b) ""impure"" modifier absent - FunC compiler will do strange things, such as strip out some code without your permission. It will silently remove the function call in two cases: a) function returns nothing: () fun() { } b) function returns something, but this something is not assigned to anything: ``` (int) fun() { return 5; } ... int a = fun(); ;; fun is called fun(); ;; fun call is removed" ```