Thanks Alex ... I think I am getting there :) - It's pretty neat the more I
get into it!
If I understand correctly - the filter clause is redundant because it does
not subset the records generated by the generator?
When I look at the filter used in app/gui.l I wonder if the filter
(range @Nr @@ nr) does anything - I mean, the generator would only generate
records where nr is in the range - is that not right?
(quote
@Nr (and *CuSuNr (cons @ T))
@Nm *CuSuNm
@Tel *CuSuTel
@Plz *CuSuPlz
@Ort *CuSuOrt
@Mob *CuSuMob
(select (@@)
((nr +CuSu @Nr) (nm +CuSu @Nm) (tel +CuSu @Tel)
(plz +CuSu @Plz) (ort +CuSu @Ort) (mob +CuSu @Mob) )
(range @Nr @@ nr)
(tolr @Nm @@ nm)
(fold @Tel @@ tel)
(head @Plz @@ plz)
(part @Ort @@ ort)
(fold @Mob @@ mob) ) ) )
Regards,
Kashyap
On Thu, Oct 24, 2019 at 12:42 AM Alexander Burger <[email protected]>
wrote:
> Hi Kashyap,
>
> > : (? (select (@Tel) ( (mob +CuSu "37 176 86303") ) ))
> > @Tel={C1}
> > ...
> > : (? (select (@Tel) ( (mob +CuSu "37 176 86303" tel +CuSu "37 176
> 86303") )
> > ))
> > -> NIL
> >
> > The first query returned as expected. The second one I believe means -
> look
> > for "37 176 86303" either in tel or in mob. I expected the second query
> to
> > return the same result as the first query
>
> Almost correct :)
>
> It just needs an extra parenthesis for the combined search:
>
> : (? (select (@C) (((mob +CuSu "37 176 86303" tel +CuSu "37 176
> 86303")))))
> @C={C1}
> -> NIL
>
>
> or, to generalize it:
>
> : (?
> @Tel "37 176 86303"
> (select (@C)
> (((mob +CuSu @Tel tel +CuSu @Tel))) ) )
> @Tel="37 176 86303" @C={C1}
>
>
> or, for real usage, with the proper filter clause:
>
> : (?
> @Tel "37 176 86303"
> (select (@C)
> (((mob +CuSu @Tel tel +CuSu @Tel)))
> (or
> ((fold @Tel @C mob))
> ((fold @Tel @C tel)) ) ) )
> @Tel="37 176 86303" @C={C1}
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
>