From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.devel Subject: Re: Some ideas with Emacs Date: Fri, 29 Nov 2019 10:56:03 -0300 Message-ID: References: <837e3iq0ks.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000da768c05987c9764" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="165585"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , Anonymous , Emacs developers To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 29 15:08:05 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iagwH-000gvY-8p for ged-emacs-devel@m.gmane.org; Fri, 29 Nov 2019 15:08:05 +0100 Original-Received: from localhost ([::1]:59508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iagwD-0003rv-Uk for ged-emacs-devel@m.gmane.org; Fri, 29 Nov 2019 09:08:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55051) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iagl1-0007GA-Hi for emacs-devel@gnu.org; Fri, 29 Nov 2019 08:56:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iagkx-0003m8-DA for emacs-devel@gnu.org; Fri, 29 Nov 2019 08:56:25 -0500 Original-Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:35603) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iagkt-0003Hf-J3; Fri, 29 Nov 2019 08:56:19 -0500 Original-Received: by mail-pl1-x62c.google.com with SMTP id s10so12945651plp.2; Fri, 29 Nov 2019 05:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A+bLJEC1P0qFTT5V92SVtFvDVKDTAZKlZKxIk7/ftQY=; b=I0MREIfSPXMYUc2q9wDdK3LADWw+PlV12fdgZ8fjfRBzVuEArEC9LJ93EqOe7PvjOI E0L/nnqQmEAmmxJb4Bnnrq8jSTgpSCU8WtUjrzyvluN00yCaLTkgtHTAzzxPnvdbF6n2 Yzly3war0KVEHmsf0SmOGDQq/YYfkuTzAgbrxPKf5eTykcwLTOwHFz1fhHTx5g2mqgcF ZoRo0fT2PYqxrQlrf+Ncn2ozYvOu3jdV+y3S4Pelzc3OfgGteTJ3yIbUz+V5lFS/d340 /F7GbwaFvCwXh+m1qJr2pA53tchm46t8JHFsIdj7qaUpVh47DTlVHK/stfeopfym3oAM YUCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A+bLJEC1P0qFTT5V92SVtFvDVKDTAZKlZKxIk7/ftQY=; b=qqsO6MGr6W04ihFdsIpFPGUZ1HGGroK5GSkFek6q/YlZepI9cEcRjg8UQiZ8QclXPj zHbDQ56iXR0oJJEBfb76yRwLHlbmNkCgVCGLWERInnz0iqYlMA9nvzsEOyu0Dk0Q2sUe U7qe//23vovOo4NuSCexP7olmfZSbeO4R3aTwLXZRWvc1L3IuLnDtpRU6J2PACRUUvYZ V+rgSpzDNjqf0eIavU/65dryLOHXvtufoJZiFvIhkTsVsXTUR+CZHRseb3ydeHcvuoV2 Y8B9px5YdXalvlAT+7DcdaUq1dFjFHy8uTxpgdVvQSRxQyH+3DyADy78AG/KxrFWBSNh 8p7Q== X-Gm-Message-State: APjAAAVoJxG1bPYVjsmnLxQxHVIAGmeOqU0e32uh9h2/ln9oAWNft2yF FJD/Amt/dDhwRAUxjkU5cIGbpJTh3YZu21niaxI= X-Google-Smtp-Source: APXvYqxJZh4zskW1AWy5AMuvR93YrZvZJZqe2E/H2muZCC3zAOQKHXuKF/oAT6vwvQpHL31/cDXacv3u6SNE0gMpSD8= X-Received: by 2002:a17:90a:5895:: with SMTP id j21mr19401102pji.129.1575035774595; Fri, 29 Nov 2019 05:56:14 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242871 Archived-At: --000000000000da768c05987c9764 Content-Type: text/plain; charset="UTF-8" Hi Anonymous and other people, most people test small snippets of elisp code by executing sexps with `C-x C-e' or variants of it, not by loading elisp files. My (admittedly biased!) feeling is that the best way to help beginners learn Lisp is by giving them sexps to play with - configurations, plugins, and even long texts in English, are secondary... I tried to do something in this direction in a package that I wrote called "eev" that I often use to teach Emacs and programming to total beginners - here are some links to it: http://angg.twu.net/#eev http://angg.twu.net/emacsconf2019.html http://elpa.gnu.org/packages/eev.html It comes with lots of tutorials. If you run (find-eev-quick-intro) (find-eev-intro) (find-eval-intro) these sexps will open three of its "sandboxed tutorials" in temporary read-write buffers; I use read-write buffers to let users play with the sexps in them more easily. Here are links to the htmlized versions of these three tutorials: http://angg.twu.net/eev-intros/find-eev-quick-intro.html http://angg.twu.net/eev-intros/find-eev-intro.html http://angg.twu.net/eev-intros/find-eval-intro.html The tutorial in (find-eval-intro) is one of the ones that is still very messy and in need of being rewritten, but there are is a section in it I think that is relevant to this discussion. You can access it with: http://angg.twu.net/eev-intros/find-eval-intro.html#10 (find-eval-intro "10. More on functions") but let me copy it here... 10. More on functions ===================== A symbol - for example `f' - can be both a varible and a function; its "value as a variable" and its "value as a function" are stored in different places. Try: (setq f 2) (setq f 5) (defun f (x) (* x x)) (defun f (x) (* 10 x)) (symbol-value 'f) (symbol-function 'f) This is explained here: (find-elnode "Symbol Components") (find-elnode "Symbol Components" "value cell") (find-elnode "Symbol Components" "function cell") The content of a "function cell" is _usually_ a lambda expression. See: (find-elnode "Lambda Expressions") (find-elnode "What Is a Function") (find-elnode "What Is a Function" "lambda expression") (find-elnode "What Is a Function" "byte-code function") Try: (setq f 2) (setq f 5) (set 'f 2) (set 'f 5) (fset 'f (lambda (x) (* x x))) (fset 'f (lambda (x) (* 10 x))) (defun f (x) (* 10 x)) (defun f (x) (* x x)) (symbol-value 'f) (symbol-function 'f) (f 4) (f f) ((lambda (x) (* x x)) 4) ((lambda (x) (* 10 x)) 4) I have only used that particular section in a couple of workshops - i.e., in situations where the participants could easily try things, discuss with their neighbors, and ask questions - but the point is that I feel that we need more material like this... and I would love to work with other people to produce it. Cheers, Eduardo Ochs http://angg.twu.net/#eev On Fri, 29 Nov 2019 at 10:44, Stefan Kangas wrote: > Eli Zaretskii writes: > > > I think if we want to have an ELisp tutorial, it should be a separate > > manual. The current ELisp manual is a reference manual, and written > > as such. > > I fail to see why a reference manual can't also include examples. > I've had to search the web to understand how to use things before, > even after having carefully read the relevant parts of the elisp > manual and the doc string. An example says a thousand words, as the > saying goes... > > I think the Python documentation is very good in this regard. Here is > one example: > > https://docs.python.org/3/library/stdtypes.html#mapping-types-dict > > To be clear, I'm not suggesting that we should mandate that we should > include examples. But I'd suggest to optionally add them where it > makes sense, and possibly then only in the info version of the manual > (since we lack space in the print edition). > > Best regards, > Stefan Kangas > > --000000000000da768c05987c9764 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Anonymous and other people,

most people test sma= ll snippets of elisp code by executing sexps with
`C-x C-e' or varia= nts of it, not by loading elisp files. My
(admittedly biased!) feeling i= s that the best way to help beginners
learn Lisp is by giving them sexps= to play with - configurations,
plugins, and even long texts in English,= are secondary...

I tried to do something in this direction in a pac= kage that I wrote
called "eev" that I often use to teach Emacs= and programming to total
beginners - here are some links to it:

= =C2=A0 http://angg.twu.net/#eev=C2=A0 http://angg.twu.= net/emacsconf2019.html
=C2=A0 http://elpa.gnu.org/packages/eev.html

It comes with = lots of tutorials. If you run

=C2=A0 (find-eev-quick-intro)
=C2= =A0 (find-eev-intro)
=C2=A0 (find-eval-intro)

these sexps will op= en three of its "sandboxed tutorials" in temporary
read-write = buffers; I use read-write buffers to let users play with
the sexps in th= em more easily. Here are links to the htmlized versions
of these three t= utorials:

=C2=A0 http://angg.twu.net/eev-intros/find-eev-quick-intro.html<= /a>
=C2=A0
http://angg.twu.net/eev-intros/find-eev-intro.html
=C2=A0 http://angg.twu.ne= t/eev-intros/find-eval-intro.html

The tutorial in (find-eval-int= ro) is one of the ones that is still
very messy and in need of being rew= ritten, but there are is a section
in it I think that is relevant to thi= s discussion. You can access it
with:

=C2=A0 http://angg.twu.net/eev-intr= os/find-eval-intro.html#10
=C2=A0 (find-eval-intro "10. More on= functions")

but let me copy it here...



=C2=A0 1= 0. More on functions
=C2=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D
=C2=A0 A symbol - for example `f' - can be bot= h a varible and a
=C2=A0 function; its "value as a variable" a= nd its "value as a
=C2=A0 function" are stored in different pl= aces. Try:
=C2=A0
=C2=A0 =C2=A0 (setq f 2)
=C2=A0 =C2=A0 (setq f = 5)
=C2=A0 =C2=A0 (defun f (x) (* x x))
=C2=A0 =C2=A0 (defun f (x) (* = 10 x))
=C2=A0 =C2=A0 (symbol-value =C2=A0 =C2=A0'f)
=C2=A0 =C2=A0= (symbol-function 'f)
=C2=A0
=C2=A0 This is explained here:
= =C2=A0
=C2=A0 =C2=A0 (find-elnode "Symbol Components")
=C2= =A0 =C2=A0 (find-elnode "Symbol Components" "value cell"= ;)
=C2=A0 =C2=A0 (find-elnode "Symbol Components" "functi= on cell")
=C2=A0
=C2=A0 The content of a "function cell&qu= ot; is _usually_ a lambda
=C2=A0 expression. See:
=C2=A0
=C2=A0 = =C2=A0 (find-elnode "Lambda Expressions")
=C2=A0 =C2=A0 (find-= elnode "What Is a Function")
=C2=A0 =C2=A0 (find-elnode "= What Is a Function" "lambda expression")
=C2=A0 =C2=A0 (f= ind-elnode "What Is a Function" "byte-code function")=C2=A0
=C2=A0 Try:
=C2=A0
=C2=A0 =C2=A0 (setq f 2)
=C2=A0 = =C2=A0 (setq f 5)
=C2=A0 =C2=A0 (set 'f 2)
=C2=A0 =C2=A0 (set = 9;f 5)
=C2=A0 =C2=A0 (fset 'f (lambda (x) (* x x)))
=C2=A0 =C2=A0= (fset 'f (lambda (x) (* 10 x)))
=C2=A0 =C2=A0 (defun f (x) (* 10 x)= )
=C2=A0 =C2=A0 (defun f (x) (* x x))
=C2=A0 =C2=A0 (symbol-value =C2= =A0 =C2=A0'f)
=C2=A0 =C2=A0 (symbol-function 'f)
=C2=A0 =C2= =A0 (f 4)
=C2=A0 =C2=A0 (f f)
=C2=A0
=C2=A0 =C2=A0 ((lambda (x) (= * x x))
=C2=A0 =C2=A0 =C2=A04)
=C2=A0 =C2=A0 ((lambda (x) (* 10 x))=C2=A0 =C2=A0 =C2=A04)
=C2=A0

I have only used that particular= section in a couple of workshops -
i.e., in situations where the partic= ipants could easily try things,
discuss with their neighbors, and ask qu= estions - but the point is
that I feel that we need more material like t= his... and I would love
to work with other people to produce it.

= =C2=A0 Cheers,
=C2=A0 =C2=A0 Eduardo Ochs
=C2=A0 =C2=A0 http://angg.twu.net/#eev


On F= ri, 29 Nov 2019 at 10:44, Stefan Kangas <stefan@marxist.se> wrote:
Eli Zaretskii <eliz@gnu.org> writes:

> I think if we want to have an ELisp tutorial, it should be a separate<= br> > manual.=C2=A0 The current ELisp manual is a reference manual, and writ= ten
> as such.

I fail to see why a reference manual can't also include examples.
I've had to search the web to understand how to use things before,
even after having carefully read the relevant parts of the elisp
manual and the doc string.=C2=A0 An example says a thousand words, as the saying goes...

I think the Python documentation is very good in this regard.=C2=A0 Here is=
one example:

https://docs.python.org/3/library/= stdtypes.html#mapping-types-dict

To be clear, I'm not suggesting that we should mandate that we should include examples.=C2=A0 But I'd suggest to optionally add them where it=
makes sense, and possibly then only in the info version of the manual
(since we lack space in the print edition).

Best regards,
Stefan Kangas

--000000000000da768c05987c9764--