Wouldn't sort(branch1, branch2, ...) be the same as sort(x => [branch1(x), branch2(x), ...])?
Oh I see actually implementing is hard
How about if there's more than one branch, you group by the result of the first branch, then inside that, group by the result of the second, and so on until each group only has one element, and then sort?
@user not when it starts becoming confusingly verbose
I ended up with things nested 5 levels in parenthesis
Because you have to wrap each branch in a lambda and then call that in a call to VFun.execute and compare those in a call to MiscHelpers.compareExact which is already in a call to group by and it's not just a flat list of VAny, it's a list of 2tuples because ctx-m exists so then there's indexing into each 2tuple
And then you mix recursion into all of that and it just becomes unpleasant
+ it's really easy to get lost in the types being thrown around
You've got a Seq in one place, some sort of iterable thing in another, VList required and a Map with VAny as keys
(quick interlude and a reminder for me for after lunch: I need to look into why a variable followed by execute-lambda at the end of a program seems to be moved to the front - also, look into whether or not variables are being combined into groups in the arity grouping phase. Also I need to specifically test to see how something like ... $abs execute-lambda is being parsed - I'll make a test for it)
I clearly have more confidence in the library than you :p
in other news, I wrote a function for the parser and completely forgot to use it
and spent the last 5 minutes wondering why things weren't working
5 6 λx,y|#$x #$y +} Ė
> 11
and the tests fail
wonderful
java.lang.NullPointerException: Cannot invoke "String.isEmpty()" because "$this" is null
[info] at scala.collection.StringOps$.nonEmpty$extension(StringOps.scala:1168)
[info] at vyxal.Context.pop(Context.scala:57)
huh
you know you've done something wrong when you get a java error in your scala
!!/status: I will tell you what I'm doing (maybe). If you don't have a sense of humor and/or are a bot developer, run !!/status boring for actual status information.
!!/do you do ne do ne do ne do ne do ne are is do ne do ne do ne do ne do ne is are are are are is is is is is is is is are do ne do ne do ne is are are is are is are is do ne are is do ?