Bug SS-2315
1 vote

cases() from Custom Functions doesn't allow creating third row

Created by Mike Kaganski on 4/13/2016 4:48 AM Last Updated by Mike Kaganski on 4/19/2016 1:47 PM
%
 (hrs)
Logged: 0   (hrs)

 Description

In 0.98.5935, it's impossible to enter third row in cases() - it collapses into a tiny rectangle and doesn't acccept further input. It cannot be copied to clipboard to paste to a text editor.

It's possible to combine proper cases(#,#,#,#,#) manually in a text editor to insert into the sheet, though.

    Mike Kaganski (Tuesday, April 19, 2016 1:47 PM) #

Well, maybe if Andrey will add the official feature to add several placeholders at once for you, it will also enable him to allow adding new rows to non-vector matrices :) like it is possible now for column or row vectors.

    Davide (Tuesday, April 19, 2016 2:36 AM) #

No problem, isn't my native tongue too :)

Updated:

- cases(even_number_of_arguments) returns "function not defined";

- now it is possible to delete placeholders;

 

Ah, Busted! ;-)

 

    Mike Kaganski (Tuesday, April 19, 2016 2:21 AM) #

Thank you very much,

I musunderstood you when you said "undressed" (I imagined that white rectangle thing). English isn't my native tongue, you know. :)

Thank you very much!

 

(btw, in your example, both first and second conditions are true for T.R:=1)

    Davide (Tuesday, April 19, 2016 2:13 AM) #

That is how it works now in the latest NB :) (except that I've forget to filter the result for even cases, I'll update in minutes);

Not very comfortable for editing, especially if you have several conditions and "long" functions, still usable.

 

 

 

    Mike Kaganski (Tuesday, April 19, 2016 2:07 AM) #

Well, about those even cases: can't your plugin reject such cases as the ones that this plugin doesn't handle? Then, it will turn into simple functional form, just like if you try to add arguments to sum() or for() - it turns to simple functional form, then to decorated, then again to simple.

    Davide (Tuesday, April 19, 2016 1:48 AM) #

Hello Mike, please update both CustomGlyphs and CustomFunctions for latest Nighlty Build;

Yes Andrey has made a lot of changes in the APIs about glyphs drawing, to improve speed and stability; as side effects now we have an official and reliable way to choose how and what arguments to use as default when the user insert a function (as for the truth this was available even before, but I wasn't able to find it, and was buggy).

Another side effect is that I'm no more able to override the arguments to add 2 placeholders instead of one; this means that the function will be "undressed" when there are an even number of arguments. Andrey says that he have to think how to provide what I need in an official way. Also he has suggested to implement cases for such cases (even arguments - without the otherwise condition), that is something I was already thinking (the output should be a "not defined" error in numerical mode, not yet found what to do in symbolical mode).

    Mike Kaganski (Monday, April 18, 2016 11:49 PM) #

Davide,

please check the function in latest 0.98.5952. It seems broken again - I suppose Andrey does a lot of refactoring that affects your "hacks".

I'm sure he does, because he just fixed bug with somewhat similar problem when el() didn't add extra placeholder. :)

It is created with only one placeholder right away - and looks "scary" :) Then if you insert new placeholder, it becomew "whitespace", but eventually third placeholder makes it right. After that, it repeats whe "white-normal" sequence with every new placeholer. Is that intended?

    Davide (Wednesday, April 13, 2016 7:44 PM) #

Thank you Mike!

The issue is triggered by my hack to add 2 placeholders at once, seems no more supported in SS 0.98.

Code slighty modified and plugin updated; also now cases(3) should be added by default instead of cases(1) (another small trick).

Let me know if you still experience problems.