Details
In Lucid (and other dataflow languages) an expression that contains a variable that was not yet bound waits until the variable is bound before proceeding. An expression like x + y
will wait until both x and y are bound before returning with the output of the expression. An important result of this is that explicit logic for updating related values is avoided, which results in substantial code reduction compared to mainstream languages.
Each variable in Lucid is a stream of values. An expression n = 1 fby n + 1
defines a stream using the operator 'fby' (a mnemonic for "followed by"). fby defines what comes after the previous expression. (In this instance the stream produces 1,2,3,...). The values in a stream can be addressed by these operators (assuming x is the variable being used):
'first x'
- fetches the first value in the stream x,
'x'
- the current value of the stream,
'next x'
- fetches the next value in the stream.
'asa'
- an operator that does some thing 'as soon as' the condition given becomes true.
'x upon p'
- upon is an operator that repeats the old value of the stream x, and updates to the new values only when the stream p makes a true
value available. (It serves to slow down the stream x) i.e.: x upon p
is the stream x with new values appearing upon the truth of p.
The computation is carried out by defining filters or transformation functions that act on these time-varying streams of data.
pLucid was the first interpreter for Lucid.
Read more about this topic: Lucid (programming Language)
Famous quotes containing the word details:
“Working women today are trying to achieve in the work world what men have achieved all alongbut men have always had the help of a woman at home who took care of all the other details of living! Today the working woman is also that woman at home, and without support services in the workplace and a respect for the work women do within and outside the home, the attempt to do both is taking its tollon women, on men, and on our children.”
—Jeanne Elium (20th century)
“Patience is a most necessary qualification for business; many a man would rather you heard his story than granted his request. One must seem to hear the unreasonable demands of the petulant, unmoved, and the tedious details of the dull, untired. That is the least price that a man must pay for a high station.”
—Philip Dormer Stanhope, 4th Earl Chesterfield (16941773)