Questions about LISP and Python.

Andrea Crotti andrea.crotti.0 at gmail.com
Wed Dec 7 05:14:41 EST 2011


On 12/06/2011 04:36 AM, Xah Lee wrote:
> i don't like python, and i prefer emacs lisp. The primary reason is
> that python is not functional, especially with python 3. The python
> community is full of fanatics with their drivels. In that respect,
> it's not unlike Common Lisp community and Scheme lisp community.
>

I love emacs and I love python, but saying that elisp is a better language
than python and more functional is plain ridiculous.
Elisp is great to extend Emacs, but with dynamic scoping and side effects
used everywhere should not even be considered between the functional
languages, at least for how it's mainly used.

This is a typical usage taken from simple.el
(defun pop-global-mark ()
   "Pop off global mark ring and jump to the top location."
   (interactive)
   ;; Pop entries which refer to non-existent buffers.
   (while (and global-mark-ring (not (marker-buffer (car 
global-mark-ring))))
     (setq global-mark-ring (cdr global-mark-ring)))
   (or global-mark-ring
       (error "No global mark set"))
   (let* ((marker (car global-mark-ring))
      (buffer (marker-buffer marker))
      (position (marker-position marker)))
     (setq global-mark-ring (nconc (cdr global-mark-ring)
                   (list (car global-mark-ring))))
     (set-buffer buffer)
     (or (and (>= position (point-min))
          (<= position (point-max)))
     (if widen-automatically
         (widen)
       (error "Global mark position is outside accessible part of buffer")))
     (goto-char position)
     (switch-to-buffer buffer)))

Which means more or elss pop a mark from the mark ring, get the current 
buffer/position,
then set the buffer, widen if necessary, go to some position and switch 
to that buffer.

Nothing wrong with it, but basically it messes around with global state, 
as most elisp functions
do.

And how python 3 would be less functional?



More information about the Python-list mailing list