Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing Get Statement Timer
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Insectoid




PostPosted: Mon Sep 10, 2012 10:09 pm   Post subject: RE:Turing Get Statement Timer

You can't declare a procedure inside a loop.
Sponsor
Sponsor
Sponsor
sponsor
QuantumPhysics




PostPosted: Tue Sep 11, 2012 7:37 am   Post subject: RE:Turing Get Statement Timer

Is a procedure in turing the same as a function in C/C++?
Raknarg




PostPosted: Tue Sep 11, 2012 9:43 am   Post subject: RE:Turing Get Statement Timer

Yes. In turing, they have both procedures and functions, but the difference is taht a function will produce a result at the end, where a prodecure simply ends. I believe in C++ when someone wants to accomplish that they make function that just results 0 and does nothing with it.

It's not necessary, but I think the creators of turing thought it would make more sense to make separate options.
2goto1




PostPosted: Tue Sep 11, 2012 10:01 am   Post subject: RE:Turing Get Statement Timer

The thought process for Turing having functions and procedures as separate entities can be summarized in the function help documentation found at http://compsci.ca/holtsoft/doc/function.html.

Here is the relevant portion:
In principle, a function (1) should not change any variables outside of itself (global variables) or (2) should not have var parameters. In other words, it should have no side effects. The original implementation prevented (1) and (2) and thereby prevented function side effects. Current implementations of Turing do not enforce this restriction.

Some languages today still actually enforce this type of rule. But I'm only familiar with database languages enforcing this type of rule today, typically for database query optimization / performance purposes.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 19 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: