« first day (10 days earlier)      last day (462 days later) » 

13:20
update: it looks like the code required for function blocks to work won't be released for a few months
so I'm going to remove them from the toolbox until then
and for that matter:
Ginger has made a change to the feeds posted into this room
now we'll get notified when it happens
 
1 hour later…
14:25
5 messages moved to ­Trash
thanks feeds
 
1 hour later…
15:53
I wish it were possible to specify more verbose messages in dropdown menus for blocks
ideally I'd have the symbol by itself in the block and the symbol with a description in the menu
guess I get to roll my own!
16:27
problem: even though I have overridden a method of a JS subclass, the parent's un-overridden constructor is calling its method instead of the subclass's one
Just override the parent's constructor then :P
Parent.prototype.method = function() { if (this instanceof Child) { ... } }
^^
that'd involve duplicating a lot of code, which I really do not want to do
Duplicating?
Just store the old one in a variable
I'd have to copy the constructor and the fifty-line utility method it calls
16:29
.apply(this, ...arguments)
@Ginger Why
because I can't call the method myself due to it being set to private
You shouldn't override it then
what?
the constructor calls a utility method which isn't exported in the built version of the library
@Ginger source?
@Ginger oh is the utility method a third method, not the one you're trying to override?
16:31
@RadvylfPrograms blockly, I'm overriding the trimOptions_ method of the FieldDropdown class
@pxeger yes
@RadvylfPrograms see this line
2 mins ago, by Radvylf Programs
.apply(this, ...arguments)
doesn't that^ work on the constructor?
eh?
I am not familiar with this "feature"
this.trimOptions_() should refer to the one in your class, not the parent
Not sure how extends works in detail though
@pxeger What do you mean
Like, create a new constructor that .applys the super constructor?
yes
16:33
I have confirmed that if I copy the constructor myself (commenting out the utility method) it calls my overriden one
I'd assume that's done my default
But maybe not
(not knowing much about JS's OOP features) I was inferring that the superclass's constructor wasn't doing that
even though it feels like it should
shall we go to another room so caird and catja can talk about actual code golf?
@pxeger JS doesn't have OOP features, it just has bugs that resemble OOP :b
@pxeger sure, we can go to the Complement room
36 messages moved from The Nineteenth Byte
that works
16:35
1 message moved from The Nineteenth Byte
so, what is this apply thing?
It calls a function but overrides its this
so I'd do super.apply(this, ...)?
No, super.apply(this, ...)
get ninja'd on
16:37
You'd supply ... as an array of arguments, or you could use .call which takes them splatted
Nope: Uncaught ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
I figured that'd happen
JS is the Ohio of programming languages
I still don't understand what makes your situation different
maybe that the class I'm overriding is a TypeScript one?
that could change something
16:39
TypeScript compiles down to JS, doesn't matter
Show me your override
class VerboseDropdown extends Blockly.FieldDropdown {
    // Have to redefine this so it uses our custom applyTrim_
    trimOptions_() {
How about the constructor
I'm overriding this function so it'll call another overridden static function which is referenced by name in the base one (as in it calls FieldDropdown.applyTrim_(...)
@RadvylfPrograms don't have one
There's your issue
You're using the parent's constructor
Add a constructor that just calls super()
._.
16:41
that's so stupid
Why does it work like that
but it didn't
@RadvylfPrograms it's still not working
Wait yeah:
Type VerboseDropdown into the console and hit enter
class VerboseDropdown extends Blockly.FieldDropdown {
    constructor(gen, f) {
        super(gen, f)
    }
    // Have to redefine this so it uses our custom applyTrim_
    trimOptions_() {
        consol…
that's the result
Oops do its .prototype
FieldDropdown$$module$build$src$core$field_dropdown {constructor: Æ’, trimOptions_: Æ’, dropdownCreate_: Æ’}
constructor
:
class VerboseDropdown
dropdownCreate_
:
Æ’ dropdownCreate_()
trimOptions_
:
Æ’ trimOptions_()
[[Prototype]]
:
Field$$module$build$src$core$field
weird
16:45
Click trimOptions_() and make sure it's the new one
brb
Y'know what I bet it is
TypeScript probably transpiled this.trimOptions_(); to some weird thing
Do FieldDropdown.prototype.constructor and see what it transpiled down to
WAIT
I bet it shortened the name of trimOptions_
If TypeScript was told it was a private method, and the transpilation output is minified (which I'd bet it is), no way it's not called x1z or something now
back (temporarily)
@RadvylfPrograms edge's being a jerk and compressing the result but it doesn't look minified at all
I can see all the method names
and g2g again
 
2 hours later…
18:40
@RadvylfPrograms any ideas for fixing the bug?
Look at FieldDropdown.prototype
Or try to make an MCVE
Field$$module$build$src$core$field {constructor: ƒ, fromXml: ƒ, loadState: ƒ, initView: ƒ, shouldAddBorderRect_: ƒ, …}
applyColour
:
Æ’ applyColour()
constructor
:
class extends
createSVGArrow_
:
Æ’ createSVGArrow_()
createTextArrow_
:
Æ’ createTextArrow_()
doClassValidation_
:
doClassValidation_(a){return this.getOptions(!0).some(b=> {…}
doValueUpdate_
:
Æ’ doValueUpdate_(a)
dropdownCreate_
:
Æ’ dropdownCreate_()
dropdownDispose_
:
Æ’ dropdownDispose_()
fromXml
:
Æ’ fromXml(a)
getOptions
:
Æ’ getOptions(a)
I don't see trimOptions_ there
Does it inherit it from what it extends?
uhhhhhhh
that's a good point
where the hell is it
maybe it gets shoehorned into the constructor during minimization?
That's why I'm saying, look at the actual constructor
18:44
that'd answer the question, at least: it's not being overrided because it's not actually there
Who knows what the transpilation/minification is doing
19:03
@RadvylfPrograms got it working!
...by copying the entire constructor, but at least it works
now to go add details and tooltips to every block
19:22
@RadvylfPrograms so just so I'm sure, the syntax for set-builder is {function | variables}?
also for that matter will we support what I'm going to call "set-builder ellipsis inference notation"?
where a set like {0, 1, 2, ...} is equal to the set of all numbers
Hmm....maybe a good ides
a
yes, but more work requiref
d
Not really, basically just a range operator
Maybe we could have it detect geometric series too
E.g., {1, 3, ..., 27}
19:34
I'm guessing {1, ..., ...} is bad syntax?
oh boy, I get to write a validator! ;-;
... would only be allowed when it's bordered on both sides by either a number of the beginning/end of the set literal
In fact, for simplicity, only the following would be allowed:
{...}, {n, ...}, {..., n}, {n, ..., n}, {n, n, ...}, {n, n, ..., n}, {n, ..., n, n}, {..., n, n}
what's {...}?
The latter 4 being for geometric series
@Ginger All integers
Maybe that one would be disallowed
19:39
that should be disallowed
it's ambiguous
In what way
it could be the set of all sets
or a set of mixed ints and sets
or anything else really
also, since we aren't going to support non-integer numbers I guess I need to remove any instance where that could be possible
19:41
the set builtins for complex numbers, etc
Natural numbers are fine
also I'll say it here: I think not supporting floats is a mistake and limits what this language will be able to do, especially in actual mathematical contexts
Those are just positive integers
but anyway
@RadvylfPrograms typo :b
@Ginger If you think you can meaningfully implement constraints on floats you go right ahead :p
19:42
what'd the issue be?
...oh
oh, right
yeah I see your point :p
but it still bugs me
maybe we could limit precision?
Maybe to single-precision floats, but that's still a massive pain
And it'd make brute forcing many many times slower
(About 4 billion to be precise)
Which is a lotta manys
how come Desmos can handle (limited) constraints easily?
is it doing something different?
I would guess symbolic math
Which we'll have to a limited extent, but Desmos never has to worry about brute forcing and we do
why?
Because it doesn't do that
19:49
wait, what exactly is the interpreter going to do? I thought that, like, the "print all numbers" program would just output <Set [1, 2, 3, ...]> or something
Dec 6 at 23:40, by Radvylf Programs
1. We convert the AST into a set of contraints on variables
2. We repeatedly perform optimizations, merging constraints where possible and searching for contradictions
3. We brute force the unsolved variables
Desmos likely works using a variety of tricks like newton-raphson to approximate answers
mfw I don't even know what the language I invented is supposed to do
@RadvylfPrograms ok so how can I figure out if a given position for an ellipsis is valid?
You check if the set literal matches one of the seven allowed patterns
hmm, ok
How you do that is up to you, I don't know what tools you have available to implement that behavior
19:55
me neither
20:12
I'm not really sure how to implement this :p
like, what happens if you try to make an invalid setup? does the ellipsis block get ejected?
(@RadvylfPrograms)
what'd be the most user-friendly way of doing it?
Don't allow invalid state
Have a separate ellipsis block that lets you pick each of the two bounds
With -inf and inf as options
oh, I shoehorned it into the existing set-builder block
Yeah I wouldn't do that
Maybe even have a whole set literals section
hmmmmmmmmmmmmmmmm
I'll do that laterâ„¢

« first day (10 days earlier)      last day (462 days later) »