emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to


From: Juanma Barranquero
Subject: Re: [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to vector and add new slots.
Date: Thu, 8 Aug 2013 19:47:57 +0200

On Thu, Aug 8, 2013 at 7:18 PM, Drew Adams <address@hidden> wrote:

> "Also"?
>
> Why would we ever want someone to use `frameset-p'?  What's the
> point of testing only for a possibly invalid structure that
> happens to have the right tag?

In some context might make sense. For frameset-to-register, for
example, the frameset-p check is not to check the frameset's validity,
just that it is of the right type, because the frameset was generated
under controlled circumstances and cannot be erroneous. If the user
has a sudden impulse to do

M-: (set-register ?a (make-frameset nil :states 'hawhaw)) <RET>
C-x r j a

s/he will get what s/he asked for. No checking will protect against
any erroneous data, after all; all the frameset-valid-p in the world
won't protect the user that wants to do

(let ((circ '(nil))
      (fs (frameset-save nil)))
  (setcdr circ circ)
  (setf (frameset-states fs) circ)
  fs)

> Not a rhetorical question.  Do we really want people relying
> on `frameset-p' (and `cl-typep') to check whether something is
> of type frameset?

You've been following this conversation and know that my preference
would be for a strong-checking frameset-p. Given that it is not going
to be so, I can abuse the implementation of cl-typep and teach the
users to do (cl-typep FRAMESET 'frameset-valid), which happens to work
;-)

   J



reply via email to

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