Yessir. I was talking about users' likely expectations for type coercion.
There are cases in elisp where numeric type coercion is the default,
e.g., (= 2.0 2) is t. I expected it to be so here, too.

If you feel this is moot, then so be it.

On Sun, Sep 8, 2024 at 2:07 AM Eli Zaretskii <e...@gnu.org> wrote:

> > From: Ship Mints <shipmi...@gmail.com>
> > Date: Sat, 7 Sep 2024 09:14:54 -0400
> >
> > This one bit me yesterday on Emacs 29.3 as I was revising my init file
> (for the thousandth time this week).
> >
> > As setopt becomes more widely recommended, people will likely encounter
> situations like the below where they
> > expect constant numeric types to be coerced.
> >
> > (defcustom temp-float "Float"
> >   "Float type."
> >   :type 'float)
> >
> > (setopt temp-float 2.0) ; works
> > (setopt temp-float 2) ; Warning (emacs): Value '2' does not match type
> float
>
> If you are going to allow integer values, shouldn't :type be 'number,
> not 'float?  The documentation of 'float says:
>
>   ‘float’
>        The value must be floating point.
>
> "Must be floating point."  The value 2 isn't.
>
  • bug#73098:... Ship Mints
    • bug#7... Eli Zaretskii
      • b... Ship Mints
        • ... Eli Zaretskii
          • ... Ship Mints
            • ... Bug reports for GNU Emacs, the Swiss army knife of text editors
              • ... Eli Zaretskii
                • ... Ship Mints
                • ... Bug reports for GNU Emacs, the Swiss army knife of text editors
                • ... Bug reports for GNU Emacs, the Swiss army knife of text editors
                • ... Eli Zaretskii
                • ... Bug reports for GNU Emacs, the Swiss army knife of text editors
                • ... Eli Zaretskii

Reply via email to