[Top][All Lists]

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

RE: Regexp bytecode disassembler

From: Drew Adams
Subject: RE: Regexp bytecode disassembler
Date: Sat, 21 Mar 2020 16:58:05 -0700 (PDT)

> > Do you mean you would prefer to use `cond' and rewrite all those
> > clauses to something like the following?
> >
> > (cond
> >  ((eql opcode 0) (cons 'no-op 1))
> >  ((eql opcode 1) (cons 'succeed 1))
> Yes.

Sorry for butting in, and I haven't followed the
thread.  But if it were I, I'd just use `case'
(aka `cl-case' now), assuming that all of the
clauses just test the value of `opcode' using

`case' automatically uses `eql', and it makes
very clear that the _only_ tests are `opcode'

To me, `pcase' would be overkill here and `cond'
would be unnecessarily verbose and wouldn't
emphasize what I said in the previous paragraph.

(case opcode
  (0  (cons 'no-op   1))
  (1  (cons 'succeed 1))

reply via email to

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