Newsgroups: comp.lang.lisp
From: Eric Eaton <zaim...@gmail.com>
Date: Thu, 11 Oct 2012 23:33:59 -0700 (PDT)
Local: Fri, Oct 12 2012 2:33 am
Subject: Re: CommonQt enums and operators
On Wednesday, October 10, 2012 9:36:54 AM UTC-7, Raymond Wiker wrote:
Yes that seems to be its function, but it was stopping before taking the + character from the stream and normal evaluation resumed on +=. The reader macro processed "operator" and interned a corresponding symbol as a side effect. I assumed this meant that the function actually existed. Changing the reader to accept the character + made everything better.
> Eric Eaton <> writes: > > On Monday, October 8, 2012 9:21:03 PM UTC-7, budden wrote:
> >> Hi! I know nothing about CommonQt, but, some general hints: o know what is *STAR* try (describe '*star*), (describe *star*), use inspector of your lisp IDE etc; Qt reader (#_) _should_ be case sensitive while CL reader is not. Also, it _might_ treat "*" in special way. It is likely to misinterpret *star*, try *STAR* or, better, just give another name to your var:
> >> (defparameter |Star| ...)
> >> (#_operator+= Star (#_new QSize 3 3))
> > Thanks for your reply.
> > The reader macro is for executing foreign functions. I am reasonably sure that it only reads the word following it, which is the name of the C++ method to be called. Overloading += in C++ is done by overloading the function named operator+=. So I assumed it would be the same in commonqt.
> > It appears that there is a function #_operator, and the += is being evaluated normally as the first argument and of course it is unbound. I have to figure out how to use it. There is no documentation which I can find on #_operator.
> I'm reasonably sure that the reader macro is #_, and the argument is
> "operator+=". That is, the reader macro does an FLI lookup of the symbol
> named "operator+=", and applies it to the two arguments.
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||