Overview F (programming language)
1 overview
1.1 operators
1.2 data types
1.3 statement , control flow
1.4 modules
overview
f designed minimal subset of fortran, 1 hundred intrinsic procedures. language keywords , intrinsic function names reserved keywords in f , no other names may take exact form. f contains same character set used in fortran 90/95 limit of 132 characters. reserved words written in lowercase. uppercase letter may appear in character constant. variable names not have restriction , can include upper , lowercase characters.
operators
f supports many of standard operators used in fortran. operators supported f are:
arithmetic operators: +, -, *, /, **
relational operators: <, <=, ==, /=, >, >=
logical operators: .not., .and., .or., .eqv., .neqv.
character concatenation: //
the assignment operator denoted equal sign =. in addition, pointer assignment denoted =>. comments denoted ! symbol:
data types
similar fortran, type specification made of type, list of attributes declared variables, , variable list. f provides same types fortran well, sole exception of doubles:
f not have intrinsic support object-oriented programming, allow records:
variable declarations followed attribute list. attributes allowed parameter, public, private, allocatable, dimension, intent, optional, pointer, save , target. attribute list followed ::, part of syntax. f allows optional initialization in list of objects. items in list have same attributes in given type declaration statement. in addition, declarations attribute oriented instead of entity oriented.
statement , control flow
f supports 3 statements control flow: if, basic conditional, case, switch statement, , do, conditional while loop. return, stop, cycle, , exit statements fortran may used break control flow.
modules
f places heavy emphasis on modular programming. modules in f called programs :
placing procedures outside of module prohibited. f supports of modules , subroutines found in fortran 95 standard library. procedures in f external default, , require result clause returns value of function. f supports recursion.
all of intrinsic procedures found in fortran 95 may used in f, exceptions of achar, iachar, lge, lgt, lge, llt, transfer, dble, dim, dprod, , mod.
Comments
Post a Comment