Hello I was wondering if lispers even implemented the Ideas john backus had about function level progarmming...there does not seem to be an implementation of his ideas on the web and since lisp is good at implementing paradigms of programming I was curious. http://www.archive.org/details/JohnBack1987
gavino <gavcom...@gmail.com> writes: > Hello I was wondering if lispers even implemented the Ideas john > backus had about function level progarmming...
There's already higher level functions in lisp. For example (see the paper of which the url is given below), insert is reduce, apply-to-all is mapcar & apply. So you can easily write your functions in functional style:
(defmacro define (name expression) `(progn (setf (symbol-function ',name) ,expression) (setf (documentation ',name 'function) ',(format nil "~S is a function defined with DEFINE~%Source: ~S" name expression)) ',name))
;; These ones still use parameters; you only need to write more utility functions ;; to be able to easily write them in functional style too. (defun transpose (x) (apply (function mapcar) (function list) x)) (defun apply-to-all (f) (lambda (x) (mapcar (lambda (y) (apply f y)) x))) (defun insert (f) (lambda (x) (reduce f x)))
;; Here is inner-product = (insert +) o (apply-to-all x) o transpose
On Mar 3, 5:26 am, p...@informatimago.com (Pascal J. Bourguignon) wrote:
> gavino <gavcom...@gmail.com> writes: > > Hello I was wondering if lispers even implemented the Ideas john > > backus had about function level progarmming...
> There's already higher level functions in lisp. For example (see the > paper of which the url is given below), insert is reduce, apply-to-all > is mapcar & apply. So you can easily write your functions in > functional style:
Boy, lisp IDIOTS are quick.
Lisp does not do functional level programing. Can't. Nor does almost all the well known functional langs such as Ocaml, Haskell, Mathematica.
hard to summarize in one sentence... but basically like functional programing but with one characteristic formalism that sets it apart, namely: creation of functions are limited to a particular set of higher-order functions, and you cannot arbitrary birth functions (e.g. the moronicity of lisp's macros).
The force of this particular formalism is that it makes it more subject to mathematical analysis (and thus makes it more powerful and flexible), similar to for example to the clear separation of features in 2nd order logic from first order logic. Wikipedia said it best, quote:
«This restriction means that functions in FP are a module (generated by the built-in functions) over the algebra of functional forms, and are thus algebraically tractable. For instance, the general question of equality of two functions is equivalent to the halting problem, and is undecidable, but equality of two functions in FP is just equality in the algebra, and thus (Backus imagines) easier.»
«Even today, many users of lambda style languages often misinterpret Backus' function-level approach as a restrictive variant of the lambda style, which is a de facto value-level style. In fact, Backus would not have disagreed with the 'restrictive' accusation: he argued that it was precisely due to such restrictions that a well-formed mathematical space could arise, in a manner analogous to the way structured programming limits programming to a restricted version of all the control-flow possibilities available in plain, unrestricted unstructured programs.»
--------------------------------
This thread, illustrates, how often comp lang fanatics propagate patently false things, in their fanaticism. This, includes those lispers who are regulars at comp.lang.lisp. (other similar issues, is how lisp syntax is regular, and how lisp are adept at lisp manipulation)
Codd and Backus were brilliant men, but their ideas are not that much practical, being set more like a high standard against which to measure practical implementations of crippled down versions of said ideas.
On Mar 3, 10:47 pm, Xah Lee <xah...@gmail.com> wrote: [...]
> Lisp does not do functional level programing. Can't. Nor does almost > all the well known functional langs such as Ocaml, Haskell, > Mathematica. [...] > hard to summarize in one sentence... but basically like functional > programing but with one characteristic formalism that sets it apart, > namely: creation of functions are limited to a particular set of > higher-order functions, and you cannot arbitrary birth functions > (e.g. the moronicity of lisp's macros).
This is a silly objection. There are quite a few languages where it's not all that hard to limit yourself to a small set of operators via one namespacing mechanism or another. Common Lisp's packages (or Mathematica's virtually identical "contexts") would certainly be adequate for the task.
And yeah, you don't need to have DEFMACRO in your function-level programming package either. Why would you?