[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing optional arguments for use with internal functions
From: |
Emanuel Berg |
Subject: |
Re: Passing optional arguments for use with internal functions |
Date: |
Mon, 31 Jul 2023 14:27:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
uzibalqa wrote:
>> ;;; -- lexical-binding: nil --
>>
>> (defvar arg)
>> (setq arg 2)
>>
>> (defun echo-arg (&optional arg)
>> (or arg (setq arg 1))
>> (message "%s" arg) )
>>
>> ;; (echo-arg)
>>
>> This will still echo 1.
>
> Now that there has been a change from dynamic to lexical
> binding, this becomes a problem. What command should one use
> to set a default value to an optional argument for the
> current lexical binding files ?
The same, since function arguments are always lexical.
--
underground experts united
https://dataswamp.org/~incal
- Re: Passing optional arguments for use with internal functions,
Emanuel Berg <=
- Re: Passing optional arguments for use with internal functions, uzibalqa, 2023/08/02
- Re: Passing optional arguments for use with internal functions, Emanuel Berg, 2023/08/02
- Re: Passing optional arguments for use with internal functions, uzibalqa, 2023/08/02
- Re: Passing optional arguments for use with internal functions, uzibalqa, 2023/08/02
- Re: Passing optional arguments for use with internal functions, Emanuel Berg, 2023/08/04
- Re: Passing optional arguments for use with internal functions, Emanuel Berg, 2023/08/04
- Re: Passing optional arguments for use with internal functions, Emanuel Berg, 2023/08/04
- Re: Passing optional arguments for use with internal functions, Emanuel Berg, 2023/08/04