On 13 September 2013 15:55, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 13/09/2013 15:43, Peter Maydell ha scritto: >> On 25 August 2013 23:58, Ákos Kovács <akoskov...@gmx.com> wrote: >>> +eq = $(if $(subst $2,,$1)$(subst $1,,$2),n,y) >>> +ne = $(if $(subst $2,,$1)$(subst $1,,$2),y,n) >> >> These give the wrong answer for comparisons >> of 'n' with ''. Working versions: >> >> eq = $(if $(filter $(call lnot,$1),$(call lnot,$2)),y,n) >> ne = $(if $(filter $(call lnot,$1),$(call lnot,$2)),n,y) > > isempty/notempty are clearly string functions, where only the output is > of the y/n form. Seeing Akos's implementation of isempty/notempty, I > think the desired semantics for eq/ne/isempty/notempty are also those of > string functions. > > I would call your functions leqv/lxor, not eq/ne.
Sounds reasonable -- I was led a little astray by them all being in a patch whose only documentation was the phrase "logical functions"... > Your patch is fine if you either rename eq/ne like this, > or revert them to Akos's version. It sounds like we probably want two patches: 1. logical functions: land/lor/leqv/lxor/lnot 2. string functions: eq/ne/isempty/notempty I assume we do end up using eq/ne somewhere? -- PMM