Appropriate operators for assignment semantics in a non-pure declarative language -
I am preparing a declarative language to define the signal network to represent the group of nodes in the network I want to use variable binding. It happened to me that there are two types of "assignment", which I want to do for these variables.
On one side, the output of a specific group should represent one variable, this output of the signal operator can then be connected to another input. It is important for different output directives at different places, for example:
a, b, c = (signal with three outputs) (signal bea) (signal c) (Signal D)
In this case, there will be a signal A with three outputs, where the first and third outputs are connected to signal B and signal C respectively, and before Signal signal A Are connected to the output. The only a example of Signal A is
On the other hand, a variable should represent the normal pattern of the signal operation, so that it is easy to regenerate a normal configuration.
a = (signal A (signal B)) (signal cA) (signal A)
In this case, / Code> to represent the structure of signal A and signal B, and this signal has been redone as the input of signal c and signal two Examples are:
So my question is, in functional / declarative programming, are common words for these two assignment words? And in my language, which should be got '=', and what would be a normal operator for the other? (Probably: =?)
I realized that if each signal actually represents the Pure function, then both of these will be identical, but in my case it It is possible that there are side effects when the signal is processed, so I need to distinguish between these two cases.
This is the last time of my bed, so I can not read enough carefully but what else Is the case like an anonymous function? Your syntax looks to be visible already, so I wonder what Lisp's shortcut syntax for the lambda function, what do you want.
a = '(signal a (signal b))
If your use is not actually equal in Lambda's meaning, then it may be more confusing Will cause.
BTW, in the first case, you can follow the rear of the idea of Pearl with the list assignment: (a, b, c) = (signal A with three outputs)
Do not know that it will be helpful; I am not experienced outside customary languages like Pearl and C.
Comments
Post a Comment