A comparison of object oriented scripting languages.Python by Kaustub D.

By Kaustub D.

Show description

Read Online or Download A comparison of object oriented scripting languages.Python and Ruby PDF

Best programming: programming languages books

Additional info for A comparison of object oriented scripting languages.Python and Ruby

Sample text

However, as the while command provides looping functionality, the action is repeated numerous times, as in the foreach command. How to do it… In the following recipe, we will create a Tcl script, to be called from the command line, that increments the value of x and prints out the value as in the for command recipe. tcl x = 1 x = 2 x = 3 x = 4 x = 5 x = 6 x = 7 x = 8 x = 9 x = 10 How it works… The action was invoked a total of 10 times as in the previous example. Continuing a procedure While the continue keyword is not a control construct in itself, it allows you to affect the control flow.

The -indices and -inline options must be used to modify the behavior, as indicated by this statement. But it doesn't stop there; by providing switches, you can control the behavior of regexp. The switches are as follows: Switch -about Behavior -expanded Allows the use of expanded regular expression, wherein whitespaces and comments are ignored. -indices Returns a list of two decimal strings, containing the indices in the string to match for the first and last characters in the range. -line Enables the newline-sensitive matching similar to passing the –linestop and –lineanchor switches.

All Causes the command to match as many times as possible and returns the count of the matches found. -inline Causes regexp to return a list of the data that would otherwise have been placed in match variables. No actual matching is made. Instead regexp returns a list containing information about the regular expression where the first element is a subexpression count and the second is a list of property names describing various attributes about the expression. Match variables may NOT be used if –inline is specified.

Download PDF sample

Rated 4.62 of 5 – based on 49 votes