When you want to use the fields of a type as arguments to a function or 
where you want to apply a type-wrapped version an imported operator, 
TypedDelegation is  available.

Eight macros are exported.  Four are for use where one field within a type 
is needed, and four where two fields within a type are needed.  Each group 
supports functions over one or two variables of a given type:. 
signbit(x), !=(x,y).  Each group supports operations on a given type that 
return results of that type:  abs(x), +(x,y).
See the README <https://github.com/JuliaArbTypes/TypedDelegation.jl> for 
examples of their use.

        #     apply functions through a given Type T, using one field as a 
parameter
        #
        #           evaluates as the type that the function returns
        @delegate_oneField,                       #  fn(x::T)
        @delegate_oneField_fromTwoVars,           #  fn(x::T, y::T)
        #
        #           evaluates as the type that is used in delegation
        @delegate_oneField_asType,                #  op(x::T)::T
        @delegate_oneField_fromTwoVars_asType,    #  op(x::T, y::T)::T
                                                  #
        #     apply functions through a given Type, using two fields as 
parameters
        #
        #           evaluates as the type that the function returns
        @delegate_twoFields,                      #  fn(x::T)
        @delegate_twoFields_fromTwoVars,          #  fn(x::T, y::T)
        #
        #           evaluates as the type that is used in delegation
        @delegate_twoFields_asType,               #  op(x::T)::T
        @delegate_twoFields_fromTwoVars_asType    #  op(x::T, y::T)::T





    

Reply via email to