New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0: CBLQueryExpression "and:" and "or:" methods cause syntax errors in Obj-C++ #1862

Closed
snej opened this Issue Aug 16, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@snej
Member

snej commented Aug 16, 2017

I tried using an and: operation in a query in an Objective-C++ file and got a syntax error:

/Couchbase/2.0/Objective-C/Tests/TunesPerfTest.mm:221:67: error: expected expression
                             where: [[ARTIST notNullOrMissing] and: [COMP nullOrMissing]]
                                                                  ^

The same thing happens with or:.

I think the method names will need to be changed.

@snej snej added this to the 2.0.0 milestone Aug 16, 2017

@snej snej added f: Query bug labels Aug 16, 2017

@pasin

This comment has been minimized.

Contributor

pasin commented Aug 16, 2017

Maybe andWith: and orWith:?

@snej

This comment has been minimized.

Member

snej commented Aug 16, 2017

andExpression: and orExpression: would follow the Obj-C idiom of using the parameter type in the selector. But it's your call of course :)

@pasin

This comment has been minimized.

Contributor

pasin commented Aug 16, 2017

Thanks @snej . I tried with andWith:, and it feels weird when reading the where clause. andExpression: feels better but seems to be long. I will do more research and see if I can come up with a better name.

@snej

This comment has been minimized.

Member

snej commented Aug 17, 2017

Maybe French? et: and ou: :)

@pasin

This comment has been minimized.

Contributor

pasin commented Aug 18, 2017

I wished I could use et: and ou:. I changed them to andExpression: and orExpression:.

@pasin pasin closed this Aug 18, 2017

@pasin

This comment has been minimized.

Contributor

pasin commented Aug 18, 2017

Fixed in b2569b3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment