[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Check for redundancy
From: |
Óscar Fuentes |
Subject: |
Re: Check for redundancy |
Date: |
Thu, 25 Jun 2015 04:03:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> The term is not specific to programming: expressing things which have been
>> expressed already.
>
> Obviously, Drew knows that. The issue is that if you want to check for
> redundancy in code, it's presumably by doing it with another piece of
> code. That other piece of code will have to encode formally what you
> mean by redundancy, so to be able to write it, you'll need to describe
> formally what you mean by redundancy. And that's pretty damn hard for
> the usual interesting cases of redundancy.
A pretty easy (and safe) way is to define redundancy as "functional
equivalence" (which is what the OP mean, I think) and then compare the
generated bytecode. If it is the same, the functions are equivalent.
That doesn't work if different constructs with the same effects (`if' vs
`cond') compile to different bytecode, but that doesn't preclude its
practical usefulness.
C++ compilers do that for template functions, for avoiding code
explosion. Certain C++ compiler does that for ordinary functions as
well.
[snip]
- Re: Check for redundancy, (continued)
- Re: Check for redundancy, Robert Thorpe, 2015/06/27
- Re: Check for redundancy, tomas, 2015/06/27
- Re: Check for redundancy, Emanuel Berg, 2015/06/27
- Re: Check for redundancy, tomas, 2015/06/28
- Re: Check for redundancy, Emanuel Berg, 2015/06/28
- Re: Check for redundancy, Yuri Khan, 2015/06/28
- Re: Check for redundancy, Emanuel Berg, 2015/06/28
- Re: Check for redundancy, Robert Thorpe, 2015/06/28
- Re: Check for redundancy, Emanuel Berg, 2015/06/28
- Re: Check for redundancy, Emanuel Berg, 2015/06/24
- Re: Check for redundancy,
Óscar Fuentes <=
- Re: Check for redundancy, Emanuel Berg, 2015/06/24
- Re: Check for redundancy, Óscar Fuentes, 2015/06/24
- Re: Check for redundancy, Emanuel Berg, 2015/06/24
- Message not available
- Re: Check for redundancy, Stefan Nobis, 2015/06/25
- Re: Check for redundancy, Andreas Röhler, 2015/06/25
- Re: Check for redundancy, Emanuel Berg, 2015/06/26
- Re: Check for redundancy, Emanuel Berg, 2015/06/26
- Message not available
- Re: Check for redundancy, Stefan Nobis, 2015/06/27
- Re: Check for redundancy, Emanuel Berg, 2015/06/27
- Re: Check for redundancy, Emanuel Berg, 2015/06/27