This wiki is static and therefore read-only as of August 2011. More information here.
Hosted by NexuizNinjaz.com

This is an old revision of the document!


Sandbox


Use this page to test the syntax.

dev:quakec


Because dokuwiki has NO TALK PAGE and I didn't want to edit quakec article directly:

  • float .field is the same as float *pointer_to_float in c, while self.field is self→field in c, where self is structure and field is its member

Therefore, doing this:

.float field1;
.float field2;
.float field3;
.float field4;
field1 = field2;  // points to the same float
self.field1 = 8;  // self.field2 is also 8
self.field3 = 66; 
self.field4 = self.field2; // self.field4 is 8
self.field4 = self.field3; // self.field4 is 66, self.field3 is 66, self.field2 and self.field1 have values of 8


it is not clear whether the space for float pointed from field1 was allocated during pointer declaration or not and whether quakecVM does some sort of garbage collecting. If not, it should be mentioned that programming like previous example is bad habit cause it will leak memory;

  • it should be mentioned that startpos should be 0 in substring if you want to search whole string and that generally strings are indexed from 0 upwards (no negative length, etc...);
  • can't see the difference between n fields and field of array type, which has n elements (both are accessed the same e.(array[index])) If there is difference, an explanation would be useful;
  • pointers to functions chapter is confusing. Which way is the general way? Separate var keyword explanation could be useful. As well, that original quakec didn't have neither typedef nor var and that fteqcc has a const keyword to separate variables from constants.
 
playground/playground.1224942687.txt.gz · Last modified: 2008/10/25 15:51 by 193.219.93.218
Nexuiz Ninjaz Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
GFDL logoGFDLcontent Unless mentioned on the licensing page, the work on this page is licensed under the GNU Free Documentation License. The author states that the text and images can be used within the restrictions of this license (for example, they can be incorporated into certain free encyclopedias such as Wikipedia).
Kindly hosted by NexuizNinjaz.com