Feature #461
New keyword "|->"? (same as "return")
Description
Here is an idea (silly?)
We could add the new keyword |->
which has the same semantics as Return
. This would be handy inside short anonymous functions:
fn := Func (X) Return X^2-2; EndFunc;
could become
fn := Func (X) |-> X^2-2 EndFunc;
It's not a great improvement, but at least it is conceptually simple :-)
History
#1
Updated by Anna Maria Bigatti about 10 years ago
- Target version set to CoCoA-5.1.0 Easter14
#2
Updated by John Abbott about 10 years ago
- Target version changed from CoCoA-5.1.0 Easter14 to CoCoA-5.1.1 Seoul14
#3
Updated by John Abbott almost 10 years ago
- Target version changed from CoCoA-5.1.1 Seoul14 to CoCoA-5.?.?
#4
Updated by Anna Maria Bigatti almost 10 years ago
- Subject changed from New keyword? to New keyword "|->"? (same as "return")
- Target version changed from CoCoA-5.?.? to CoCoA-5.1.1 Seoul14
#5
Updated by John Abbott almost 10 years ago
- Target version changed from CoCoA-5.1.1 Seoul14 to CoCoA-5.?.?
#6
Updated by John Abbott almost 2 years ago
- Target version changed from CoCoA-5.?.? to CoCoA-5.4.2
The idea is fairly nice, but does not bring much benefit.
I do not relish the idea of modifying the parser/interpreter unless truly necessary.
So I suggest rejecting this proposal: too much work for too little benefit.
#7
Updated by Anna Maria Bigatti almost 2 years ago
John Abbott wrote:
The idea is fairly nice, but does not bring much benefit.
I do not relish the idea of modifying the parser/interpreter unless truly necessary.So I suggest rejecting this proposal: too much work for too little benefit.
That rang some bell, so I checked: this is similar to Macaulay2:
A function can be created with the arrow operator, -> . i19 : f = i -> i^3
the structure is anyway quite different, so this might be more confusing than handy.
I agree on rejecting.
#8
Updated by Anna Maria Bigatti almost 2 years ago
- Status changed from New to Rejected
#9
Updated by John Abbott almost 2 years ago
- Assignee set to John Abbott
- % Done changed from 0 to 100