[spam][crazy] advanced coding therapy
Undescribed Horrific Abuse, One Victim & Survivor of Many
gmkarl at gmail.com
Fri Dec 1 07:24:21 PST 2023
> class Expression {};
>
> class OperatorExpression {}; // an expression that is the evaluation of a
> parameterized operator on operands (could elide into Expression);
>
> class Operator {};
>
Operator addition;
Operator subtraction;
template <class T> _add(T x, T y) { return x + y; }
template <class T> _subtract(T x, T y) { return x - y; }
Operator addition = Operator(
/*
here i’ll take a break to help myself remember the idea of swizzling
operands rather than using inverses. if we consider the output of a
function as a further operand, than an inverse is simply a different
statement of the same relation between groups of numbers, and operators of
different arity can be considered in the same manner. i’m sure there’s some
mathematical name for this that i haven’t learned,
so rather than Addition and Subtraction one approach could be to consider
something that combines them, where addition is the solution for the
largest operand and subtraction is the solution for one of the smaller ones
…
*/
template <int total_arity>
class ScalarRelation {};
/*
so what parameterizes a scalar relation? maybe known functions between some
of the operands. for addition we know x + y = z how do i specify this: how
about here as a type-templated function associated with two numbered
operands?
i’ll want a way to refer to it, so that it can be bundled into an
expression …
additionally more is needed than a type-templated function, e.g. i’d want
the character “+”
got some confusion here
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/html
Size: 2396 bytes
Desc: not available
URL: <https://lists.cpunks.org/pipermail/cypherpunks/attachments/20231201/ecc91030/attachment.txt>
More information about the cypherpunks
mailing list