• New Bie question:How to learn Emacs Lisp in a comfortable way?

    From =?UTF-8?B?5YiY6Zuo5qGl?=@21:1/5 to All on Fri Jun 15 08:59:05 2018
    Hi,Everyone ,I have use emacs for several years,unfortunately I do not understand lisp programmed,after reading the book "An Introduction to Programming in Emacs Lisp" for several days,I got a litter tired to understand emacs lisp,any suggestion?

    How can I learn emacs lisp in a comfortable way?By the way ,I know C\C++ and Java.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Kallweitt@21:1/5 to jacklisp@gmail.com on Fri Jun 15 18:24:51 2018
    刘雨桥 <jacklisp@gmail.com> wrote:

    How can I learn emacs lisp in a comfortable way?By the way ,I know
    C\C++ and Java.

    As you may have noticed, Lisp is very different from C, C++, and Jave.

    In order to learn Emacs Lisp, I'd suggest that you start by reading a
    general introduction to the Lisp language to grasp the basic concepts,
    and then continue with some manuals or more specialised works on Emacs
    Lisp.

    It is also a good idea to visit the elisp directory of your Emacs
    installation, and try to understand what the .el files in there are all
    about.


    --
    www.wasfuereintheater.com - Neue Theaterprojekte im Ruhrpott
    »DAS UNBEKANNTE SCHÖN ZU FINDEN. DEM UNVERSTANDENEN MIT WÄRME ZU BEGEGNEN. DAS IST WAHRE LIEBE« Barbara Bollwahn, https://www.taz.de/!472086/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James K. Lowden@21:1/5 to jacklisp@gmail.com on Fri Jun 15 19:24:57 2018
    On Fri, 15 Jun 2018 08:59:05 -0700 (PDT)
    ??? <jacklisp@gmail.com> wrote:

    How can I learn emacs lisp in a comfortable way?

    I read The Structure and Interpretation of Computer Programs (SICP, https://mitpress.mit.edu/sicp/). It's not about emacs, but then it's
    not exactly about Lisp, either. It's a way to learn the concepts from
    the ground up. I can't think of a better way.

    --jkl

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?5YiY6Zuo5qGl?=@21:1/5 to All on Sat Jun 16 00:46:16 2018
    How can I learn emacs lisp in a comfortable way?

    I read The Structure and Interpretation of Computer Programs (SICP, https://mitpress.mit.edu/sicp/). It's not about emacs, but then it's
    not exactly about Lisp, either. It's a way to learn the concepts from
    the ground up. I can't think of a better way.

    --jkl

    SICP is a good book, and the schema dialect it uses is also a kind of lisp. However, some of the important contents involved in the emacs lisp are not covered in this book, such as "buffer". Did your point out thar I shall understand SICP all the concept
    first before learning emacs lisp?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marko Rauhamaa@21:1/5 to All on Sat Jun 16 12:13:29 2018
    "James K. Lowden" <jklowden@speakeasy.net>:

    On Fri, 15 Jun 2018 08:59:05 -0700 (PDT)
    ??? <jacklisp@gmail.com> wrote:

    How can I learn emacs lisp in a comfortable way?

    I read The Structure and Interpretation of Computer Programs (SICP, https://mitpress.mit.edu/sicp/). It's not about emacs, but then it's
    not exactly about Lisp, either. It's a way to learn the concepts from
    the ground up. I can't think of a better way.

    IMO, SICP is a good way to stifle interest in programming.


    Marko

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marko Rauhamaa@21:1/5 to All on Sat Jun 16 12:25:50 2018
    Michael Kallweitt <michael.kallweitt@posteo.de>:

    刘雨桥 <jacklisp@gmail.com> wrote:

    How can I learn emacs lisp in a comfortable way?By the way ,I know
    C\C++ and Java.

    As you may have noticed, Lisp is very different from C, C++, and Jave.

    Actually, lisp is not all that different at all.

    In C and the like, you call a function like this:

    f(a, b, 3);

    In Lisp, you move the function name inside the parentheses:

    (f a b 3)

    In C et al, you have traditional, infix expressions:

    a * (3 - b / 2)

    In lisp, you use a prefix notation, and never drop parentheses:

    (* a (- 3 (/ b 2)))


    Lisp, like Java and Python, uses garbage collection. Lisp, like Python,
    allows any variable to hold a value of any type.

    Idiomatic lisp favors heavy use of recursion instead of "while" or
    "for", but "while" is available in lisp, as well.


    Marko

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?5YiY6Zuo5qGl?=@21:1/5 to All on Sat Jun 16 08:49:43 2018
    在 2018年6月16日星期六 UTC+8下午5:25:54,Marko Rauhamaa写道:
    Michael Kallweitt <michael.kallweitt@posteo.de>:

    刘雨桥 <jacklisp@gmail.com> wrote:

    How can I learn emacs lisp in a comfortable way?By the way ,I know
    C\C++ and Java.

    As you may have noticed, Lisp is very different from C, C++, and Jave.

    Actually, lisp is not all that different at all.

    In C and the like, you call a function like this:

    f(a, b, 3);

    In Lisp, you move the function name inside the parentheses:

    (f a b 3)

    In C et al, you have traditional, infix expressions:

    a * (3 - b / 2)

    In lisp, you use a prefix notation, and never drop parentheses:

    (* a (- 3 (/ b 2)))


    Lisp, like Java and Python, uses garbage collection. Lisp, like Python, allows any variable to hold a value of any type.

    Idiomatic lisp favors heavy use of recursion instead of "while" or
    "for", but "while" is available in lisp, as well.


    Marko

    Thinks a lot!
    compare as C language,when function become more complex,I found Lisp function become
    a little more hard to read and understand, such as this example: -----------------------------------------------------------
    (defun append-to-buffer (buffer start end)
    "Append to specified buffer the text of the region.
    It is inserted into that buffer before its point.
    When calling from a program, give three arguments:
    BUFFER (or buffer name), START and END.
    START and END specify the portion of the current buffer to be copied." (interactive
    (list (read-buffer "Append to buffer: " (other-buffer
    (current-buffer) t))
    (region-beginning) (region-end)))
    (let ((oldbuf (current-buffer)))
    (save-excursion
    (let* ((append-to (get-buffer-create buffer))
    (windows (get-buffer-window-list append-to t t))
    point)
    (set-buffer append-to)
    (setq point (point))
    (barf-if-buffer-read-only)
    (insert-buffer-substring oldbuf start end)
    (dolist (window windows)
    (when (= (window-point window) point)
    (set-window-point window (point)))))))) ------------------------------------------------
    The code above is too many function call,I have to check and found about them in Emacs mannual page for a long time,and some of them is a little more hard to understand ,such as (interactive .... function

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gene@21:1/5 to All on Sat Jun 16 10:49:13 2018
    On Friday, June 15, 2018 at 11:59:07 AM UTC-4, 刘雨桥 wrote:

    Hi,Everyone ,I have use emacs for several years,unfortunately
    I do not understand lisp programmed,after reading the book
    "An Introduction to Programming in Emacs Lisp"
    for several days,I got a litter tired to understand emacs lisp,any suggestion?

    My suggestion is to start from the position of a generic, common lisp programmer by reading at least the first chapter or 2 of Common Lisp: A Gentle Introduction.
    {ref: http://www.cs.cmu.edu/~dst/LispBook/ }

    Then, after chapter one, factor in the `Domain specific language' suchness of elisp by supplanting the number-based examples used by Touretsky with text-based examples such as `insert', `concat', `mapconcat' and `split-string' implemented via elisp.


    How can I learn emacs lisp in a comfortable way?

    See below.

    By the way ,I know C\C++ and Java.

    You've put the cart before the horse.
    Having been biased by languages pathogenically promotive of Cancer of the Semicolon
    {ref: http://uncyclopedia.wikia.com/wiki/Semicolon_Cancer}
    the learning of Lisp SHOULD promote a degree of discomfort in the form of cognitive dissonance.

    What if cons cells in `programming' are as vital as glial cells to cognition?

    What if C-style `pointers' are routinely used at too low a level to allow more-abstract levels of design -- certainly the domain-specific language level -- to ensue without distraction from such minutia ... but the lisp's inbuilt use of singly-linked
    lists DOES allow and promote high-enough forms of abstract thought to DO domain-specific sorts of activities programmatically?

    What if one extrapolates C-style null-terminated character strings into lisp style singly-linked lists?

    Why learn elisp when you can learn The Lisps at the same time?
    Why not craft symbolic expressions which can be fed to REPLs in common lisp, elisp, scheme and closure in a locked step fashion?
    Perhaps even several implementations of scheme: GUILE, chicken, scm, PLT scheme, etc?

    Just a few thoughts.
    Good luck with your Quixotic Quest.

    Gene

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?5YiY6Zuo5qGl?=@21:1/5 to All on Mon Jun 18 00:08:45 2018
    在 2018年6月17日星期日 UTC+8上午1:49:14,Gene写道:
    On Friday, June 15, 2018 at 11:59:07 AM UTC-4, 刘雨桥 wrote:

    Hi,Everyone ,I have use emacs for several years,unfortunately
    I do not understand lisp programmed,after reading the book
    "An Introduction to Programming in Emacs Lisp"
    for several days,I got a litter tired to understand emacs lisp,any suggestion?

    My suggestion is to start from the position of a generic, common lisp programmer by reading at least the first chapter or 2 of Common Lisp: A Gentle Introduction.
    {ref: http://www.cs.cmu.edu/~dst/LispBook/ }

    Then, after chapter one, factor in the `Domain specific language' suchness of elisp by supplanting the number-based examples used by Touretsky with text-based examples such as `insert', `concat', `mapconcat' and `split-string' implemented via elisp.


    How can I learn emacs lisp in a comfortable way?

    See below.

    By the way ,I know C\C++ and Java.

    You've put the cart before the horse.
    Having been biased by languages pathogenically promotive of Cancer of the Semicolon
    {ref: http://uncyclopedia.wikia.com/wiki/Semicolon_Cancer}
    the learning of Lisp SHOULD promote a degree of discomfort in the form of cognitive dissonance.

    What if cons cells in `programming' are as vital as glial cells to cognition?

    What if C-style `pointers' are routinely used at too low a level to allow more-abstract levels of design -- certainly the domain-specific language level -- to ensue without distraction from such minutia ... but the lisp's inbuilt use of singly-linked
    lists DOES allow and promote high-enough forms of abstract thought to DO domain-specific sorts of activities programmatically?

    What if one extrapolates C-style null-terminated character strings into lisp style singly-linked lists?

    Why learn elisp when you can learn The Lisps at the same time?
    Why not craft symbolic expressions which can be fed to REPLs in common lisp, elisp, scheme and closure in a locked step fashion?
    Perhaps even several implementations of scheme: GUILE, chicken, scm, PLT scheme, etc?

    Just a few thoughts.
    Good luck with your Quixotic Quest.

    Gene

    Thank you for your answer, let me shine!
    I know what to do. Thank you for the materials and ideas you provided. Be grateful!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Taylor@21:1/5 to All on Sun Jul 1 21:27:14 2018
    If you're so inclined, ftp.gnu.org still has the introductory elisp
    manual under /gnu/emacs. I recommend installing it as a texinfo manual,
    then reading it from Emacs. Split the window and open a *scratch* buffer
    so that you can follow along with it. It sounds like fun.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)