Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: mandrav on July 03, 2006, 01:33:53 pm

Title: Merging of scripting_squirrel branch to trunk is planned
Post by: mandrav on July 03, 2006, 01:33:53 pm
Later today, the scripting_squirrel branch will be merged to trunk. Be prepared :)
I also started writing documentation about scripting in Code::Blocks. Find it here (http://wiki.codeblocks.org/index.php?title=Scripting_Code::Blocks) and tell me if you find something's wrong.

EDIT:
For those not following the development of Code::Blocks, we have replaced AngelScript by Squirrel in that branch and have been testing for a week or two.
This means that if you have written scripts for Code::Blocks, you will have to convert them. Luckily, squirrel follows a C++ syntax too so only a few semantics must be changed in your scripts.
Here are the most important changes:

Title: Re: Merging of scripting_squirrel branch to trunk is planned
Post by: nfz on July 03, 2006, 05:06:05 pm
Thanks for the heads up.  I was just going to submit a project wizard for Ogre + MinGW + STLPort but will hold off and update the script to squirrel format and re-test.
Title: Re: Merging of scripting_squirrel branch to trunk is planned
Post by: MortenMacFly on July 03, 2006, 06:46:02 pm
I'd like to extend mandrav's list with one additional point:
  • All literal strings must be surrounded by _T() (e.g. _T("hello"))
  • Squirrel is typeless. If you have a declaration like wxString s="hello";, change it to local s=_T("hello");. Same goes for all types.
  • Because of the above, functions don't have return types. So replace all function return specifications with the word function.
Title: Re: Merging of scripting_squirrel branch to trunk is planned
Post by: nfz on July 04, 2006, 04:00:18 am
Thanks, I was just going to dive into the scripter and I figured I'd check here first since I was sure someone else had already hit this problem.
Title: Re: Merging of scripting_squirrel branch to trunk is planned
Post by: mandrav on July 04, 2006, 08:11:13 am
Thanks, I was just going to dive into the scripter and I figured I'd check here first since I was sure someone else had already hit this problem.

The point is that I couldn't find out how to overload operator==() in squirrel.
So wxString::Match() comes to the rescue. The good thing about it is that it accepts wildcards (* and ?) :).
Title: Re: Merging of scripting_squirrel branch to trunk is planned
Post by: MortenMacFly on July 04, 2006, 02:26:35 pm
The point is that I couldn't find out how to overload operator==() in squirrel.
BTW: Is is worth asking the Squirrel devs about this?!
Title: Re: Merging of scripting_squirrel branch to trunk is planned
Post by: mandrav on July 04, 2006, 02:33:46 pm
Well, I couldn't find anything about it in the (otherwise excellent) documentation. I didn't bother asking yet because I didn't think it's that important.
Title: Re: Merging of scripting_squirrel branch to trunk is planned
Post by: sethjackson on July 04, 2006, 02:36:30 pm
The point is that I couldn't find out how to overload operator==() in squirrel.
BTW: Is is worth asking the Squirrel devs about this?!

http://www.squirrel-lang.org/forums/491/ShowPost.aspx

I'm looking at the DXSquirrel sample now.....
Title: Re: Merging of scripting_squirrel branch to trunk is planned
Post by: mandrav on July 04, 2006, 02:57:58 pm
The point is that I couldn't find out how to overload operator==() in squirrel.
BTW: Is is worth asking the Squirrel devs about this?!

http://www.squirrel-lang.org/forums/491/ShowPost.aspx

I'm looking at the DXSquirrel sample now.....

Before you dive deeply, let me tell you that I know about the _cmp() metamethod and this works for every other comparison except equality...