Re: Re: Proposal: Placeholder operator

2019-01-11 Thread dante federici
Any reason you don't like the empty space with a comma? I also don't, but that's what it is now: ```js arr.map(( , index) => ...) ``` Also wouldn't mind ? or *, since I associate ! with "not" as a unary operator, but "*" isn't a unary in JS. ___ es-disc

Re: Re: How to prettify output of objects in the console, when using get/set, like browsers do?

2019-01-10 Thread dante federici
So, it actually all works as you'd expect when using properties on the class itself: ```js ``` In that polyfilll, it actually is making x, y, z, and w private fields: https://github.com/trusktr/geometry-interfaces/blob/41d8cca9c0b4e4ab7afbb9a3a1d02ca94d048f3f/src/DOMPoint.js#L2 ```js const _ = o

Re: Re: Proposal for faster this assignments in constructor functions

2018-12-07 Thread dante federici
I can see that, although I'm struggling to come to that conclusion if I saw that block of code fresh. I don't think it would be immediately clear, though. In your interpretation of "this has 5 arguments", what would you expect them to be? `constructor(x, y, a, b, c)`? Just prepend them? I'm trying

Re: Re: Proposal for faster this assignments in constructor functions

2018-12-06 Thread dante federici
Any reason we can't consider a scala-like constructor? ```js class Point(x, y) { toString() { return `(${this.x},${this.y})` } } console.log(`??? ${new Point(1, 2)}`); // ??? 1,2 Doesn't conflict with existing syntax, it's clear, and you can still shorthand most data-classes or stru

Re: Re: Add "???" Unimplemented

2018-03-25 Thread dante federici
r a new website? > Send me an email and we can get started. > www.isiahmeadows.com > > > On Fri, Mar 23, 2018 at 11:16 AM, dante federici > wrote: > > Simple example (ts): > > ```typescript > > interface SearchFunc { > > (source: string, subString: st

Re: Re: Add "???" Unimplemented

2018-03-23 Thread dante federici
Simple example (ts): ```typescript interface SearchFunc { (source: string, subString: string): boolean; } // Later let mySearch: SearchFunc; mySearch = function(source: string, subString: string) { ??? } ``` Simple example (js): ```js class MyClass = { foo() { return "foo"; } bar() { ret

Add "???" Unimplemented

2018-03-20 Thread dante federici
With the advent of TypeScript, classes, etc one feature I liked from scala is: `???`, the [Predef.???]( https://www.scala-lang.org/api/current/scala/NotImplementedError.html) token. Basically, you can place `???` which would type as whatever the method is typed as (for things like Typescript, Symb

Re: Re: Ideas on a testing focussed code transform

2017-12-18 Thread dante federici
To add to this --- a Monad is a useful concept for separating the description of execution versus actually running the execution: https://www.wikiwand.com/en/Monad_(functional_programming) ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mo

Re: Re: import { foo, bar } as obj from 'module

2017-12-13 Thread dante federici
Definitely make a proposal for this -- I'm pretty tired of colliding utility function names and having to aggressively namespace them. It's been said but I want to just throw in another voice that this will 100% work with tree shaking, and as we get better at organizing our modules and dependencie

Re: Re: Definition mixins

2017-11-27 Thread dante federici
I'm having a little trouble parsing your proposed syntax. Can you formalize it a bit better? Am I write in guessing that it's more like sugar around bind and composition? Like, what's going on here? mixin obj, mixinFunc1 as method1: privateState, privateStateObj; I guess I'm wondering why this

Re: Re: Set.prototype.toggle

2017-10-29 Thread dante federici
I guess a better way to phrase my argument is: What situation are you in where you don't know the current state? That is, consider the following: ``` if (enabled) { set render state to "enabled", set action to "delete" } else { set render state to "disabled", set action to "add" } ``` vers

Re: Re: Set.prototype.toggle

2017-10-29 Thread dante federici
What's the case for toggle other than nice to have? In general, I find toggle actions to be implicitly dependent on existing state -- that is, anywhere you have toggle you can just as easily say `add(value)` or `delete(value)`. ___ es-discuss mailing list

Re: Re: Array.prototype.mapOn method

2017-10-27 Thread dante federici
I'd be -1 on adding something like this to the language. This is better solved with a library. Transducers are a much better general solution than by stacking or adding special array functions. You don't want to solve the "map with filter" case, since there are many, many more combinations (take a

Re: Re: Shorter syntax for arrow function assignment

2017-10-25 Thread dante federici
Sorry I was unclear -- I was referring to "If we were to add this syntax, then seeing this code with knowing how JS interprets the current syntax, I would expect [x] to be the outcome" I wasn't trying to imply it would work as-is -- either way, sorry for not being clear. If anything the confusion

Re: Re: Shorter syntax for arrow function assignment

2017-10-24 Thread dante federici
The use case fading away doesn't mean you can drop support for it, or that it won't still be in use. Please stop trying to push your "shorthand" syntax of: ``` myFn() { } ``` It's already been pointed out in multiple cases that: 1. The current usages are not "outmoded" 2. The proposed syntax has

Re: Re: Since we're discussing arrow functions and syntax...

2017-10-24 Thread dante federici
I'd check out the bind and pipe operators: https://github.com/tc39/proposal-bind-operator https://github.com/tc39/proposal-pipeline-operator But my problems are `=>` and `->` would really lead to some sadness. ___ es-discuss mailing list es-discuss@mozil

Re: Re: Shorter syntax for arrow function assignment

2017-10-24 Thread dante federici
Another annoying thing JS has to deal with is: ``` // implicitly 'var' someVar = 10; ``` So, something like: ``` myFn() { } ``` Would be considered as: ``` var myFn = function() { } ``` with what semantics exist now. Not best practices, but what is currently interpreted in the language. I'd 100

Re: Re: Shorter syntax for arrow function assignment

2017-10-24 Thread dante federici
My major concern is this can be confusing with the "this" binding. The object wrapping being the only difference between: ``` // Existing: const x = { myFn() { } }; // Proposed, with different meaning: const myFn() { } // Why would "this" bind to myFn? ``` Omitting the arrow is a major -1 for me

Re: Re: Make comma at the end of line optional

2017-09-12 Thread dante federici
I can totally feel the, English break with, Commas especially, as a part of speech; Semicolons do a great job of delineating sentences and statements; But I have a special heart for separating bits from bytes. I guess a return is a period? Either way --- I think my opinions are: * end of stateme

Re: Re: Make comma at the end of line optional

2017-09-12 Thread dante federici
I mean, it's the general case of the "get" and "set" when defining a method: https://www.ecma-international.org/ecma-262/6.0/#sec-method-definitions-runtime-semantics-propertydefinitionevaluation That being said, there's a lot of "you just shouldn't do that" in javascript. Looking at you, `undefin

Re: Re: Make comma at the end of line optional

2017-09-12 Thread dante federici
In terms of style, and in terms of version control, either of these are fine: ```js const obj = { x: 10 y: 23 }; // or const obj2 = { x: 10, y: 23, }; ``` The mixed case is the most obnoxious one: ```js const bad = { x: 12, y: 7 } ``` However, as pointed out, there is ambiguity with

Re: Re: Make comma at the end of line optional

2017-09-12 Thread dante federici
I think the only place I see as a current inconsistency is with class definitions vs object definitions. It probably should have been looped into the object shorthand definition: https://github.com/tc39/proposal-class-fields ```js class MyClass { prop = 123 constructor() {} method() {} } ```

Re: Re: Make comma at the end of line optional

2017-09-12 Thread dante federici
What benefit does this give the language? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Native Function Composition

2017-08-24 Thread dante federici
This is probably covered by the pipeline operator proposal: https://github.com/tc39/proposal-pipeline-operator ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Strawman: `Function.prototype.try` (or `Function.try`)

2017-08-22 Thread dante federici
There exist lots of libraries that give this sort of functionality among others in the functional community -- lots of Either or Maybe implementations. I don't think this is a healthy addition to the spec since you would then want to consider all the other monadic goodies like mapping over these v

Re: Re: Defer expression

2017-08-20 Thread dante federici
kai zhu has a good example of solving async order problems explicitly, as opposed to banking on any defer or timeout to figure it out. I'm a little curious of what you mean by "something that cannot run immediately". If it can't be run immediately, then there should be *something* you can hook in

Re: Re: A few module ideas

2017-08-20 Thread dante federici
- Unable to load classic scripts (and other types of resources statically e.g. conditional modules) as part of the module graph How are conditional imports static? In both examples I see the module as being async, and therefore every dependent module is async. Your "dynamic but static" is ex

Re: Re: JavaScript Versioning

2017-07-23 Thread Dante Federici
A few times now you've proposed a "use _x_" syntax to achieve breaking changes to the language. "use strict" is more an attempt to condense the language and take a first pass best practice. Not a means of "versioning" JS. The bottom line here is that browsers aren't a place for a type safe and co

Re: Re: Add an easier method for slicing and stepping strings and arrays

2017-07-23 Thread Dante Federici
This feels like an attempt to get toward python's style of slice . Which I'm not opposed to, and would like to hear how it's better than just the method. ___ es-discuss mailing list es-dis