The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
0answers
38 views

Custom iterable objects

I understand that to create objects with custom behavior with respect to existing code one uses upvalues. However, I'm at loss when it comes to guess what interface is expected from objects fed to ...
3
votes
0answers
142 views

How do I add options to a built in function, which only apply to a certain class of argument?

I'd like to add an option to a built-in function that only applies when it is given an argument of a certain form. For example, something like this approach to extending ...
1
vote
0answers
48 views

Upvalues and order of interpretation

I'm trying to use UpValues to improve the usability of some code, but I am running into an issue where the order of the UpValues is important, and I am not sure if it is my understanding or a ...
0
votes
0answers
73 views

Memoization and upvalues

Can I store an algorithm to one variable and the result as an upvalue to another? With regard to the problematic code below (real algorithm and argument test omitted), I would like to store the ...