On 12/7/2013 12:53, James K. Lowden wrote:
On Thu, 05 Dec 2013 17:52:47 -0700
Warren Young <war...@etr-usa.com> wrote:
To prove my point, I decided to divide the SQLite commands[1] into
those that modify the DB and those that do not:
Oh, let me help you out here: these aren't functions.
I was careful to call them commands, and to treat what SQL calls
"functions" separately.
Nevertheless, I think you're trying to draw a dictionary-based line here
instead of looking at fundamental concepts. A proper mathematical
function takes N arguments and returns a single constant result for
those arguments. If you have a static SQLite DB file, any SELECT
statement against it involving only tables and the pure SQL functions
qualifies as a pure function itself.
The point of this exercise was to dig down to this conceptual level,
bypassing the fuzzy terminology.
SQL is a mixed bag of true functions and non-functional [1] elements.
This thread is about one confusion that can result when these two
aspects of SQL intermix[2] in unexpected ways.
I remember reading an essay by a user of controlled substances
Your next reading assignment is a book[3] on a functional programming
language, preferably one with immutable-by-default values. Haskell is
the current hotness, but Erlang would work just as well.
There are less pure FP languages that can teach the same lessons, if you
diligently avoid the impure bits: the ML family[4], Scala, Scheme...
The rest of your post I answered indirectly in my reply to your other
message in this thread.
--------
Footnotes:
[1] In the mathematical sense. I.e. not meaning "broken".
[2] e.g. "SELECT ... date('now')"
[3] Free online FP books:
http://learnyouahaskell.com/chapters
http://learnyousomeerlang.com/content
http://ocaml.org/learn/books.html
https://en.wikibooks.org/wiki/F_Sharp_Programming
http://www.scala-lang.org/documentation/books.html
http://www.scheme.com/tspl4/
https://mitpress.mit.edu/sicp/
[4] OCaml and F# are the most-used flavors of ML in practice currently.
Academia still has a lot of Standard ML holdouts.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users