-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Labels
bugSomething isn't workingSomething isn't workingresearchThis requires a deeper dive to gather a better understandingThis requires a deeper dive to gather a better understanding
Milestone
Description
As is described here, adding a single column allows you to access the previous row with prev() and the new value of the previous row with prev().newValue<T>().
This enables:
df.add("fibonacci") {
if (index() < 2) 1
else prev()!!.newValue<Int>() + prev()!!.prev()!!.newValue<Int>()
}I'd expect this to be equivalent:
df.add {
"fibonacci" from {
if (index() < 2) 1
else prev()!!.newValue<Int>() + prev()!!.prev()!!.newValue<Int>()
}
}but unfortunately, since from {} provides a DataRow as context instead of AddDataRow, newValue() is unavailable.
I don't know whether this was done due to a technical limitation, but if it was an oversight it surely must be added.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingresearchThis requires a deeper dive to gather a better understandingThis requires a deeper dive to gather a better understanding