help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Splitting a list with spaces and comments


From: Pierre Rouleau
Subject: Re: Splitting a list with spaces and comments
Date: Wed, 16 Aug 2023 17:20:58 -0400

Heime,

Why not just try what you want to learn directly inside Emacs?
You can use the Emacs Lisp REPLl (read-eval-print-loop) for that and
there's one built-in Emacs: ielm.
Type 'M-x ielm' and you will get a buffer with a Emacs Lisp interpreter
running.
Then inside that you can try to set variables with the values you want.
At the ELISP> prompt type any valid Emacs Lisp expression.  If there is an
error it will tell you.

Here's a session creating the csel and cset variables:


*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (setq csel '("Symbol" "Command"))
("Symbol" "Command")

ELISP> csel
("Symbol" "Command")

ELISP> (setq cseq '("alpha α"     "Beta B"     "beta β"


                    "Gamma Γ"     "gamma γ"


                    ;; some comments


                    "Delta Δ"     "delta δ"


                    "Epsilon E"   "epsilon ε"  "varepsilon ε"


                    "Zeta Z"      "zeta ζ"))
("alpha α" "Beta B" "beta β" "Gamma Γ" "gamma γ" "Delta Δ" "delta δ"
"Epsilon E" "epsilon ε" "varepsilon ε" "Zeta Z" "zeta ζ")

ELISP> cseq
("alpha α" "Beta B" "beta β" "Gamma Γ" "gamma γ" "Delta Δ" "delta δ"
"Epsilon E" "epsilon ε" "varepsilon ε" "Zeta Z" "zeta ζ")

ELISP>


On Wed, Aug 16, 2023 at 8:19 AM Heime <heimeborgia@protonmail.com> wrote:

>
> Can one split a list with spaces and comments, like so
>
> (let ( (csel '("Symbol" "Command"))
>        (cseq '("alpha α"     "Beta B"     "beta β"
>                "Gamma Γ"     "gamma γ"
>
>                ;; Additional Graphemes
>                "Delta Δ"     "delta δ"
>                "Epsilon E"   "epsilon ε"  "varepsilon ε"
>                "Zeta Z"      "zeta ζ")) ))
>
>

-- 
/Pierre


reply via email to

[Prev in Thread] Current Thread [Next in Thread]