Nice TWiki > Doc > ObjinstBeginnerExample (r1.1 vs. r1.4) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Doc . { Changes | Index | Search | Go }
 <<O>>  Difference Topic ObjinstBeginnerExample (r1.4 - 10 Jan 2004 - IsaacGouy)
Changed:
<
<

for(var i=0; i<5; i++) println( toggle.activate().value() );

>
>

for(var i=0; i<5; i++) println( toggle.activate.value );

Changed:
<
<

for(var i=0; i<8; i++) println( ntoggle.activate().value() );

>
>

for(var i=0; i<8; i++) println( ntoggle.activate.value );


 <<O>>  Difference Topic ObjinstBeginnerExample (r1.3 - 10 Jan 2004 - IsaacGouy)

 <<O>>  Difference Topic ObjinstBeginnerExample (r1.2 - 27 Aug 2003 - IsaacGouy)
Changed:
<
<

/* Please try the BeginnerExamples? before the NoviceExamples?

>
>

/* Please try the NoviceExamples? before the BeginnerExamples?

Added:
>
>

%META:TOPICMOVED{by="IsaacGouy" date="1062001866" from="Doc.ObjinstNoviceExample" to="Doc.ObjinstBeginnerExample"}%


 <<O>>  Difference Topic ObjinstBeginnerExample (r1.1 - 27 Aug 2003 - IsaacGouy)
Added:
>
>

%META:TOPICINFO{author="IsaacGouy" date="1061944080" format="1.0" version="1.1"}% %META:TOPICPARENT{name="CodeExamples"}%

/* Please try the BeginnerExamples before the NoviceExamples
To compile:
   nicec --sourcepath=.. -a objinst.jar objinst
To run:
   java -jar objinst.jar 1000000
*/


import methcall; 

void main(String[] args){
   let n = toSingleInt(args);

   var toggle = new Toggle();
   for(var i=0; i<5; i++) println( toggle.activate().value() );
   for(var i=0; i<n; i++) toggle = new Toggle();

   print('\n');

   var ntoggle = new NToggle(toggleTrigger: 3);
   for(var i=0; i<8; i++) println( ntoggle.activate().value() );
   for(var i=0; i<n; i++) ntoggle = new NToggle(toggleTrigger: 3);
}


/* Notes - language
Compare with Java at the "Win32 Language Shootout"

   import methcall; 
Reuse the implementation of class Toggle & NToggle and the
function toSingleInt that were defined in package methcall.
Assume the packages are in \project\methcall and \project\objinst 

Note that the whole package methcall is imported.
*/
-- IsaacGouy - 27 Aug 2003

Topic ObjinstBeginnerExample . { View | Diffs | r1.4 | > | r1.3 | > | r1.2 | More }
Revision r1.1 - 27 Aug 2003 - 00:28 GMT - IsaacGouy
Revision r1.4 - 10 Jan 2004 - 19:05 GMT - IsaacGouy
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.