Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
CommonQt enums and operators
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric Eaton  
View profile  
 More options Oct 5 2012, 10:31 pm
Newsgroups: comp.lang.lisp
From: Eric Eaton <zaim...@gmail.com>
Date: Fri, 5 Oct 2012 19:31:14 -0700 (PDT)
Local: Fri, Oct 5 2012 10:31 pm
Subject: CommonQt enums and operators
Hi, I'm a fairly new lisp user and I wish to create a graphical application. CommonQt seems decent but is there really only one page of documentation? In particular I am struggling to figure out how to use enums, they are not a numeric type and I can't find a way to convert them to numbers. Also Qt defines some useful overloaded operators which I can't access.

CL-USER> (defparameter *size* (#_new QSize 4 4))
*SIZE*
CL-USER> (#_operator+= *size* (#_new QSize 3 3))

; in: QT-INTERNAL::|operator14| +=
;     (QT::FULL-RESOLVE-THIS +=)
;
; caught WARNING:
;   undefined variable: +=
;
; compilation unit finished
;   Undefined variable:
;     +=
;   caught 1 WARNING condition
;
; caught WARNING:
;   undefined variable: +=
;
; compilation unit finished
;   Undefined variable:
;     +=
;   caught 1 WARNING condition
; Evaluation aborted on #<UNBOUND-VARIABLE += {10030102E3}>.
CL-USER>

Anyone know if there is a way to accomplish these things?


 
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.
budden  
View profile  
 More options Oct 9 2012, 12:21 am
Newsgroups: comp.lang.lisp
From: budden <budden-l...@mail.ru>
Date: Mon, 8 Oct 2012 21:21:02 -0700 (PDT)
Local: Tues, Oct 9 2012 12:21 am
Subject: Re: CommonQt enums and operators
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))


 
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.
Eric Eaton  
View profile  
 More options Oct 10 2012, 2:01 am
Newsgroups: comp.lang.lisp
From: Eric Eaton <zaim...@gmail.com>
Date: Tue, 9 Oct 2012 23:01:02 -0700 (PDT)
Local: Wed, Oct 10 2012 2:01 am
Subject: Re: CommonQt enums and operators

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.


 
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.
Eric Eaton  
View profile  
 More options Oct 10 2012, 2:08 am
Newsgroups: comp.lang.lisp
From: Eric Eaton <zaim...@gmail.com>
Date: Tue, 9 Oct 2012 23:08:24 -0700 (PDT)
Local: Wed, Oct 10 2012 2:08 am
Subject: Re: CommonQt enums and operators

...and that is because I probably created it when I used the macro.

 
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.
Eric Eaton  
View profile  
 More options Oct 10 2012, 2:29 am
Newsgroups: comp.lang.lisp
From: Eric Eaton <zaim...@gmail.com>
Date: Tue, 9 Oct 2012 23:29:18 -0700 (PDT)
Local: Wed, Oct 10 2012 2:29 am
Subject: Re: CommonQt enums and operators

I did it! By making some trivial modifications to CommonQt. I feel like I've achieved some kind of hacker cred now XD don't spoil this for me. However I have become somewhat disenfranchised with common lisp and commonqt and I'm considering using clojure instead.

 
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.
Raymond Wiker  
View profile  
 More options Oct 10 2012, 12:36 pm
Newsgroups: comp.lang.lisp
From: Raymond Wiker <rwi...@gmail.com>
Date: Wed, 10 Oct 2012 18:36:54 +0200
Local: Wed, Oct 10 2012 12:36 pm
Subject: Re: CommonQt enums and operators

Eric Eaton <zaim...@gmail.com> 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.
budden  
View profile  
 More options Oct 11 2012, 4:58 am
Newsgroups: comp.lang.lisp
From: budden <budden-l...@mail.ru>
Date: Thu, 11 Oct 2012 01:58:10 -0700 (PDT)
Local: Thurs, Oct 11 2012 4:58 am
Subject: Re: CommonQt enums and operators
Hi! In case of "new" #_ also reads QSize so that it can tell it from QSIZE. This is what confused me, sorry for that.

 
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.
Eric Eaton  
View profile  
 More options Oct 12 2012, 2:33 am
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

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.

 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »