[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Placement of list within an interactive clause
From: |
carlmarcos |
Subject: |
Re: Placement of list within an interactive clause |
Date: |
Sun, 17 Jul 2022 01:01:30 +0200 (CEST) |
Jul 14, 2022, 21:12 by monnier@iro.umontreal.ca:
> carlmarcos@tutanota.com [2022-07-14 22:52:43] wrote:
>
>> My question was about how I can determine which parts are used to fill
>> elements to the list. Whether it is from the body of `if' and `let'
>> clauses. Perhaps I was not so articulate in the choice of words.
>>
>
> And my answer is that the expression returns a list and the origin of
> each part of the list is determined by the general semantics of Emacs
> Lisp (which is basically the same as that of all other programming
> languages in this respect).
>
> Stefan
>
I have been reading as instructed.
In summary. `(let` is a special function form. And a function in lisp returns
the value of the last expression evaluated as the return value.
Consequently, the following function will only take the last expression in the
`let' body (completing-read) to fill an element of a list for setting the
function argument `type'.
(defun myfun (type)
(interactive
(list
(let ( (rqmatch t) (initpk "mixed") (dflt "extended")
(cseq '("expression" "mixed")) )
(message "This is a message")
(completing-read "Flare_type: " cseq nil rqmatch initpk nil dflt)))))
On the other hand if I want to have multiple function arguments, I should have
(defun myfun (type other-arg)
(interactive
(let ( (rqmatch t) (initpk "mixed") (dflt "extended")
(cseq '("expression" "mixed")) )
(message "This is a message")
(list
(completing-read "Flare_type: " cseq nil
rqmatch initpk nil dflt)
(completing-read "Other_arg: " cseq nil
rqmatch initpk nil dflt)))))
- Placement of list within an interactive clause, carlmarcos, 2022/07/14
- Re: Placement of list within an interactive clause, Stefan Monnier, 2022/07/14
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/14
- Re: Placement of list within an interactive clause, Philip Kaludercic, 2022/07/14
- Re: Placement of list within an interactive clause, Stefan Monnier, 2022/07/14
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/14
- Re: Placement of list within an interactive clause, Stefan Monnier, 2022/07/14
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/14
- Message not available
- Re: Placement of list within an interactive clause,
carlmarcos <=
- Re: Placement of list within an interactive clause, Stefan Monnier, 2022/07/16
- Message not available
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/16
- Re: Placement of list within an interactive clause, Stefan Monnier, 2022/07/17
- RE: [External] : Re: Placement of list within an interactive clause, Drew Adams, 2022/07/14
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/14
- RE: [External] : Re: Placement of list within an interactive clause, Drew Adams, 2022/07/14
- Message not available
- RE: [External] : Re: Placement of list within an interactive clause, carlmarcos, 2022/07/15
Re: Placement of list within an interactive clause, Jean Louis, 2022/07/15