-
Notifications
You must be signed in to change notification settings - Fork 29
Description
In addition to the current acceptable arguments for Q.Matrix
, it ought to accept a Template literal (Template string) as a solo argument to make it trivially easy for something like this:
var m = new Q.Matrix(`
1 2 3 4
5 6 7 8`)
This makes the task of creating arbitrary matrices much more human readable than passing nested Arrays, or even just a series of Arrays. Parsing the arguments is simple: line returns indicate row breaks and white space indicates column breaks.
But the complication is that these tokens then need to be passed to Q.ComplexNumber
(which Q.Matrix
already does internally), and that constructor does not have a parser for interpreting a String. For example, var c = new Q.ComplexNumber( '1+2i' )
is not a handled use case. Yet.
Anyone want to write that complex number String parser? 😅
That’s already an open issue here: #4
(And although there’s a pull request attached to that, the code changes in that request do not seem to correspond to Q.ComplexNumber
at all.)