Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:46
    Blacksmoke16 labeled #12162
  • 02:42
    cyangle labeled #12162
  • 02:42
    cyangle opened #12162
  • Jun 25 17:03
    HertzDevil labeled #12161
  • Jun 25 17:03
    HertzDevil labeled #12161
  • Jun 25 17:03
    HertzDevil opened #12161
  • Jun 25 16:49
    Blacksmoke16 labeled #12160
  • Jun 25 16:49
    Blacksmoke16 labeled #12160
  • Jun 25 15:10
    I3oris edited #12160
  • Jun 25 15:05
    I3oris opened #12160
  • Jun 25 14:56
    Blacksmoke16 labeled #12159
  • Jun 25 14:53
    I3oris labeled #12159
  • Jun 25 14:53
    I3oris opened #12159
  • Jun 25 11:54
    straight-shoota milestoned #12158
  • Jun 25 10:59
    straight-shoota edited #12158
  • Jun 25 10:59
    straight-shoota review_requested #12158
  • Jun 25 10:59
    straight-shoota labeled #12158
  • Jun 25 10:59
    straight-shoota labeled #12158
  • Jun 25 10:59
    straight-shoota opened #12158
  • Jun 25 10:01
    straight-shoota milestoned #12094
mfiano
@mjfiano:matrix.org
[m]
This may be difficult already then...but I'll think about it tomorrow
George Dietrich
@Blacksmoke16
:grimacing: worth looking into at least
mfiano
@mjfiano:matrix.org
[m]
Are class/struct-level constants inherited?
George Dietrich
@Blacksmoke16
mfiano
@mjfiano:matrix.org
[m]
Ok that's one thing over mixins then
mfiano
@mjfiano:matrix.org
[m]
If I have a macro method on an abstract struct, will it be inherited by children such that the @type is expanded for the concrete struct?
George Dietrich
@Blacksmoke16
If you put it in a macro inherited probably
mfiano
@mjfiano:matrix.org
[m]
Ok.

Probably not, but is there an existing library for outputting tabulated numbers, particularly floats? I would like to define an #inspect method for 4x4 matrices so it looks like:

0.123 0.484824 12.434934 93.32459
10.4944 0.43244 343.3434 434.0
23.2384 29.34242 93.22424 0.12525
0.2435 0.533556789 0.645532 0.2434534

except:
1) padding should be auto-inserted such that the whitespace around each column is aligned
2) padding should be auto-inserted such that the decimal points in a column are all aligned.

George Dietrich
@Blacksmoke16
dunno if its possible with it, but might be best bet with stdlib
mfiano
@mjfiano:matrix.org
[m]
Hmm ok
mfiano
@mjfiano:matrix.org
[m]
tablo looks very close to what I want. I would definitely need it to work for 1D StaticArray's though which it doesn't support...wonder if I can overload something.
George Dietrich
@Blacksmoke16
doesnt support how?
mfiano
@mjfiano:matrix.org
[m]
docs mention it supporting only Array type, and 2D
George Dietrich
@Blacksmoke16
could call .to_a on it
ofc that would allocate memory and stuff tho but might not be terrible just for UI output like that :shrug:
mfiano
@mjfiano:matrix.org
[m]
Would have to convert it to [][] too
err
array of arrays
I'll see. I don't need most of its features and need to see if I can opt out of them, PR it, or what
like, don't want bars drawn, nor column/row labels
George Dietrich
@Blacksmoke16
problem is going come down to it storing the data as an ivar, which can't be a generic Indexable
generics might solve this but :shrug:
mfiano
@mjfiano:matrix.org
[m]
Yeah it'll all be a learning experience. Been using my over-engineered Lisp math library for about a decade, and I'm always annoyed at how difficult it is to read tabular matrix data when debugging stuff.
George Dietrich
@Blacksmoke16
whats it look like now if you just do pp @data?
mfiano
@mjfiano:matrix.org
[m]
Or rather, unformatted data period
George Dietrich
@Blacksmoke16
prob wouldn't be too bad
mfiano
@mjfiano:matrix.org
[m]
Ah, I don't have a matrix type yet
But in Lisp it looks like this, which is readable only because the PRNG seed made mostly the same digits to the left of the point:
[428.206840, 641.180912, 529.714861, 466.054420
 449.058745, 849.850763, 606.009279, 977.445823
 242.486631, 25.559494, 67.856057, 165.478953
 597.418470, 179.321626, 859.131128, 479.821710]
George Dietrich
@Blacksmoke16
ah pp by default prints a long list, not a 4x4 grid
mfiano
@mjfiano:matrix.org
[m]
So those rand methods in the ClassMethods module...
If I use inheritance, and stick those in an abstract parent struct, that isn't going to cause issues with eg; .new being undefined for the abstract type?
George Dietrich
@Blacksmoke16
if you're using inheritance now just define them as class methods in the parent and call it a day
i dont think so?
mfiano
@mjfiano:matrix.org
[m]
Ok. Inheritance does seem better by far
Unsure if I will even need any mixins for the code I have so far anyway
George Dietrich
@Blacksmoke16
id test that tho, but it should be fine assuming each child has an argless constructor
mfiano
@mjfiano:matrix.org
[m]
wait why?
oh i see what you mean
Yes, that's a given
The one thing I'm unsure about is how to get my T type parameter to resolve for the topmost type....it was passed into include before
mfiano
@mjfiano:matrix.org
[m]
Ah.
My intention is to only allow instances in this library to have Float64 for elements in the various containers, and I don't want type inference to permit anything else, so should be able to just make sure all contructors restrict their types, in addition to the above.
George Dietrich
@Blacksmoke16
then why do you need generics?
yea just do that and dont use generics
mfiano
@mjfiano:matrix.org
[m]
Probably don't anymore. I only needed it before because Indexable required a type parameter.
George Dietrich
@Blacksmoke16
generic inheritance can be kinda buggy
well it would be Indexable(Float64)