toosuto-r / qchat

KDB+ end-to-end RSA encrypted chat fun
8 stars 3 forks source link

Repeated code sections #3

Closed ThomasSmyth closed 7 years ago

ThomasSmyth commented 7 years ago

Code wrapped like this appears quite often:

ucol[.z.u;0],string[z],ucol[.z.u;1]

Could probably be replaced with a single function:

ucolw:{ucol[x;0],y,ucol[x;1]}
ucolw[.z.u;"some text"]

Additionally the 'return' functionality is repeated quite often too:

neg[value[aw]]@'0,'ccache[key[aw]]@'uvol[key aw]
neg[aw z]@0,ccache[z]

Could also be wrapped up in all and current user type functions.

I can do up a PR if you think it is worthwhile.

toosuto-r commented 7 years ago

Yeah this is nasty, but the tidying is partly done locally - been meaning to finish it up, will just continue with that, thanks!

toosuto-r commented 7 years ago

Latest commit addresses the return to client functions where behaviour is not unique, as in one instance in .c4 - this can be amended later if necessary. Colour wrapped also added - any further feedback on this?

ThomasSmyth commented 7 years ago

Looks solid, I'm going to close this issue.