Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
2 user(s) are online (2 user(s) are browsing encyclopedia)

Members: 0
Guests: 2

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Miranda programming language

Miranda is a lazy evaluation purely functional programming language developed by David Turner (computer scientist) as a successor to his earlier programming languages SASL programming language and KRC, using some concepts from ML (programming language) and Hope (programming language). Marketed by Research Software Ltd. of England, of which the word Miranda is a trademark, it was the first purely functional language to be intended for use as a commercial tool rather than for academic purposes.

The solution to most Toy problem is briefer and simpler in Miranda than in most mainstream programming languages except maybe APL programming language, and, like other functional programming language languages, its users report that it enables them to produce more reliable programs with shorter development times than with the imperative programming languages they had previously used.

It was first published in 1985, and only one interpreter was ever written for it, in C programming language for Unix-flavour operating systems. The later Haskell programming language is similar in many ways to Miranda.

=Overview=

Miranda is a Lazy_evaluation purely functional programming language. That is, it lacks side effects and imperative programming features. A Miranda program (called a script ) is a set of equations that define various mathematical functions and algebraic data types. The word set is important here: the order of the equations is, in general, irrelevant, and there is no need to define an entity prior to its use.

Since the parsing algorithm makes intelligent use of layout (indentation), there is rarely a need for bracketing statements and no statement terminators are required. This feature is also used in Occam programming language and Haskell programming language and was popularized by Python (programming language).

Commentary is introduced into regular scripts by the characters || and continue to the end of the same line. An alternative commenting convention affects an entire source code file, known as a literate script , in which every line is considered a comment unless it starts with a > sign.

Miranda s basic data types are char, num and bool. A character string is simply a list of char, while num is silently converted between two underlying forms: infinite-precision integers (a.k.a. Bignums) by default, and regular floating-point values as required.

Tuples are sequences of elements of potentially mixed types, analogous to records in Pascal-like languages, and are written delimited with parenthesis: this_employee = ( Folland, Mary , 10560, False, 35)

The list instead is the most commonly used data structure in Miranda. It is written delimited by square brackets and with comma-separated elements, all of which must be of the same type: week_days = [ Mon , Tue , Wed , Thur , Fri ] List concatenation is ++, subtraction is --, construction is :, sizing is # and indexing is !, so: days = week_days ++ [ Sat , Sun ] days = Nil :days days!0 → Nil days = days -- [ Nil ] #days → 7 There are several list-building shortcuts: .. is used for lists whose elements form an arithmetic series, with the possibility for specifying an increment other than 1: fac n = product [1..n] odd_sum = sum [1,3..100] More general and powerful list-building facilities are provided by list comprehensions (previously known as ZF expressions ), which come in two main forms: an expression applied to a series of terms, e.g.: squares = [ n * n | n primes = sieve [2..] > sieve (p:x) = p : sieve [n | n