« first day (434 days earlier)      last day (287 days later) » 

04:00
i have a smart idea
there will be a function called overload in funcs.py
and i will separate out the atoms and quicks from builtins.py
into their own separate files
(transplied atoms stay in builtins.py)
and overload will be something like:
def overload(arity, fdict):
    # return wrapper based on arity
    # that switches between types of
    # arguments and uses that to index
    # into fdict and run the apporiate
    # function
    ...
this way i can overload for: str strings, num numbers, lst lists, ils infinite lists, any any type
@lyxal feedback for ^
Why not just have a dictionary per element instead of a wrapper?
@lyxal example?
So where you define the function, you put the allowed types directly there
so?: "M": attrdict(arity=1, dx=0, Icall=lambda x: x*x, Scall=lambda x: "".join(x for i in x))
something like that?
 
1 hour later…
05:24
itsss release time
because now i will start working on v1.1.0
06:19
@PyGamer0 attrdict(arity=1,dx=0, overloads={int: "that I call lambda", str: "the s call lambda"})
 
2 hours later…
08:09
@lyxal i would need to change a lot of code :/
Wouldn't you need to anyway with the overload function?
@lyxal but with that i only need to change atoms.py
What would it look like in practice?
"M": attrdict(arity=1, call=overload(1, {int: lambda x:x*x, str: lambda x:x+x+x})),
now that i think about it
@lyxal there is only one place i need to modify calling
that is in the dyadic link and monadic link functions
plus that looks better than what i thought
Which method?
The function or dictionary?
 
2 hours later…
10:32
@lyxal dictionary
@lyxal this one
 
5 hours later…
15:38
@lyxal i think i implemented that
now for code aesthetics which looks better? ("num", "num") OR "num-num"

« first day (434 days earlier)      last day (287 days later) »