Re: Proposal: Forced Chaining Operator "!."

2020-04-24 Thread Thomas Shinnick
You are describing Perl's autovivification feature. Also possible (in that syntax) for arrays and mixed object/array chains. I liked it, but many saw it as a footgun. There was even a compile time module to turn off the feature, if the coder wanted more caution. Having mentioned Perl I will assume

Re: Re: Add "???" Unimplemented

2018-04-04 Thread Thomas Grainger
const ɁɁɁ = () => { throw new Error('Method not defined'); }; Thomas Grainger On 26 March 2018 at 06:26, Isiah Meadows <isiahmead...@gmail.com> wrote: > Even in TypeScript, `never` (the type of functions that never return - > throwing ≠ returning) is the subtype of *all* types,

Re: Improved syntax for observable mapping and subscribing

2018-03-23 Thread Thomas Grainger
You can convert an observable into an async iterator. You have to choose between discarding or buffering uniterated items On 23 Mar 2018 14:39, "Bob Myers" wrote: > Could someone jog my memory about proposals for better syntax for > observable mapping and subscribing, if any? > >

Re: Proposal: if variable initialization

2018-03-21 Thread Thomas Grainger
Is this sarcastic? On 21 Mar 2018 12:58, "kai zhu" wrote: > this is why let and const should *never* have been introduced. if we had > stuck with just var, none of these petty-arguments and bickering among > team-members/shops on scoping-styles that ultimately have *zero*

Re: add reverse() method to strings

2018-03-17 Thread Thomas Grainger
String.prototype.reverse() might break web compatibility, how about String.prototype.turnyRoundy()? On 17 Mar 2018 18:47, "Claude Pache" wrote: > > > Le 17 mars 2018 à 19:29, Oriol _ a écrit : > > Be aware your code breaks pair surrogates,

Re: Feature Proposal - async variables (like thread local storage from C)

2018-03-11 Thread Thomas Grainger
I'm pretty sure this is Zones On 11 Mar 2018 15:35, "Guy Margalit" wrote: > Hey > > It's my first attempt to contribute to ECMAScript so would love your > feedback if I better off change how I go about it. > > The problem I want to highlight is that besides argument passing

Re: Cloning WeakSet/WeakMap

2018-02-09 Thread Thomas Grainger
I think this is referring to cloning a WeakSet into another WeakSet Thomas Grainger On 9 February 2018 at 15:01, David Bruant <bruan...@gmail.com> wrote: > Hi, > > My understanding is that cloning a WeakSet into a Set would remove all its > properties related to security and

Suggestion: Infix operators/functions

2018-02-02 Thread Thomas Grainger
function f(x) { } function g(y) { } (f '.' g)(x); // z ``` Thomas Grainger ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: es7 proposal/polyfill?: base Map/WeakMap off Proxy + Weak References

2016-02-19 Thread Thomas
> Map's API could just go away and follow traditional Object assignment > and existence checks: > > map[key] = value; > > // wish JS had a null-coalescing `?` operator like Coffeescript.. > if (map[key] !== undefined || map[key] !== null) { ... } > > It's totally legal in non-Node JS to have

Re: JavaScript Language feature Idea

2016-01-22 Thread Thomas
Is this what you're thinking? Array.prototype.nth = function (n){ if(n < 0){ return this[this.length -n]; } else { return this[n]; } } Thomas Foster @thomasfoster96 Ph: +61477808008 http://thomasfoster.co/ > On 23 Jan 2016, at 4:40 PM, kdex <k...@kdex.de> wrote: >

Re: Syntax Sugar for protected state

2016-01-19 Thread Thomas
Could this be achieved with decorators? > On 19 Jan 2016, at 8:31 PM, 森建 wrote: > > Dear ES discuss subscribers, > > I'm Kenta Moriuchi, > Department of Art and Information Design > Kyushu University in Japan > > I propose `Protected State`. > > In ES2015: > > ```js >

Re: Propose simpler string constant

2015-12-16 Thread Thomas
('Blue') } Thomas > On 16 Dec 2015, at 10:02 PM, Andrea Giammarchi <andrea.giammar...@gmail.com> > wrote: > > FWIW I think If an enum should hold a unique value either "symbol" or a new > "enum" type, otherwise I think "number" would be easier

Re: Propose simpler string constant

2015-12-16 Thread Thomas
; >> On Wed, Dec 16, 2015 at 3:20 AM, Thomas <thomasjamesfos...@bigpond.com> >> wrote: >> IMHO it'd be a huge mistake to not use symbols for enums. >> >> In my head this: >> >> const colours = enum { >> Red, >> Yellow, >&g

Calling toString on function proxy throws TypeError exception

2015-10-22 Thread Thomas Greiner
> Proxies are shielded in two ways: > > - It is impossible to determine whether an object is a proxy or not (transparent virtualization). > - You can’t access a handler via its proxy (handler encapsulation). Thomas ___ es-discuss mailing list es-dis

Re: Swift style syntax

2015-10-12 Thread Thomas
> Is it possible to extend JavaScript syntax to support Swift style block > syntax[1]? > > In Swift it's possible to omit return keyword > ``` > reversed = names.sort( { s1, s2 in s1 > s2 } ) > ``` As you note below this is already possible in es6, and might I add, has much more intuitive

Re: Reflect.getDefaultParameterValues

2015-10-05 Thread Thomas
return an array, it might be useful. What are the typical use cases for this in other languages? Also, should this just be a Reflect method or should it also be available on Function.prototype? Thomas > On 6 Oct 2015, at 1:04 AM, Benjamin Gruenbaum <benjami...@gmail.com> wrote: >

Re: Alternative to Promise

2015-10-01 Thread Thomas
>> There's only one variation that's standard, and every browser is or >> will soon be implementing that one. > > How can you said so? isn’t every Promise library pass A+ test considered > standard? There is a specific variation of promises in the ECMAScript standard which is compatible with

Re: Template strings as a template language.

2015-09-15 Thread Thomas
> On 16 Sep 2015, at 12:39 AM, Claude Pache wrote: > > That doesn't make much sense, because regexpes are first-class objects, while > template literals are syntax. > > The nearest equivalent of the string-to-regexp feature is the string-to-code > conversion facility

Re: Template strings as a template language.

2015-09-14 Thread Thomas
9 AM, Andrea Giammarchi >> <andrea.giammar...@gmail.com> wrote: >> without using eval, discussed already months ago >> >> >>> On Mon, Sep 14, 2015 at 6:03 AM, Thomas <thomasjamesfos...@bigpond.com> >>> wrote: >>> For those interested

Re: Template strings as a template language.

2015-09-14 Thread Thomas
you any plans to make the String.prototype.template function a proposal? Thomas > On 15 Sep 2015, at 1:52 AM, Andrea Giammarchi <andrea.giammar...@gmail.com> > wrote: > > again, Function **is** better and different than eval, but I see this > conversation is bringing noth

Re: Template strings as a template language.

2015-09-14 Thread Thomas
that you're not confident about it being successful in that sense, but a built in function for this trumps with and Function any day of the week. Thomas > On 15 Sep 2015, at 3:42 AM, Andrea Giammarchi <andrea.giammar...@gmail.com> > wrote: > > nobody here raised the minima

Template strings as a template language.

2015-09-13 Thread Thomas
I'd really like to use Template strings as a templating language, but unless I include a lot of boilerplate code (export a template string wrapped in a function from a file) or use eval after loading a file as a string it's pretty much impossible. Is there a simpler way to be doing this? Or

Re: Template strings as a template language.

2015-09-13 Thread Thomas
They would be whatever they are in the scope in which the template string is evaluated. Thomas > On 14 Sep 2015, at 12:15 AM, Mark S. Miller <erig...@google.com> wrote: > > > >> On Sun, Sep 13, 2015 at 7:08 AM, Thomas <thomasjamesfos...@bigpond.com> >

Re: Template strings as a template language.

2015-09-13 Thread Thomas
ing expression. Thomas * I'm aware that someone could still put something inside a template string and do nasty stuff, but I'm not sure if that's a easily solved problem. > On 13 Sep 2015, at 10:08 PM, Mark S. Miller <erig...@google.com> wrote: > >> On Sun, Sep 13, 2015 at 2:42 AM, T

Re: Template strings as a template language.

2015-09-13 Thread Thomas
and maintainability, it would be nice to keep the templates separate from the code that uses them, and not have them inlined. The best solution for my use case would be to have a special eval function which would evaluate a normal string variable as if it was a template string, in the current scope. Thomas

Re: Template strings as a template language.

2015-09-13 Thread Thomas
> On 14 Sep 2015, at 1:38 AM, Alexander Jones wrote: > > Not exactly sure what you mean. But if you are you asking how > > ```js > let template = 'this ${foo} and that ${bar}'; > // later... > let output = String.evalTemplate(template, {foo: "thing", bar: "other > thing"}); >

Re: Template strings as a template language.

2015-09-13 Thread Thomas
For those interested, this gist better shows what's being discussed: https://gist.github.com/thomasfoster96/193e7c08aae499f810a1 Ron: Yes, that's already possible - but tagged template strings don't really offer much of an advantage over a function as far as templating goes (IMHO). Thomas

Re: es-discuss Digest, Vol 103, Issue 30

2015-09-13 Thread Thomas
e person managing the list at >> es-discuss-ow...@mozilla.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of es-discuss digest..." >> Today's Topics: >> >>1. Re: Template strings as a

Re: Exponentiation operator precedence

2015-08-26 Thread Thomas
need to express an equation in text. It could be made explicit that ** is a variant on 'exponentiation', but then maybe things are deviating from being useful. Thomas On 27 Aug 2015, at 3:28 AM, Brendan Eich bren...@mozilla.org wrote: Yehuda Katz cited an acronym taught when he was a wee lad

Re: Exponentiation operator precedence

2015-08-25 Thread Thomas
Exponentiation behave differently in JavaScript to how it does elsewhere is going to be a constant source of bugs and needing parentheses just to get the desire behaviour negates the whole point of making it an operator vs a function. Thomas On 26 Aug 2015, at 1:49 AM, Allen Wirfs-Brock al...@wirfs

NativeError Introductory Text Error?

2015-07-23 Thread Thomas Wood
? I'll also note here that the name property is typeset in the wrong font. I'd have put this directly into the bugzilla instance, but I'm not receiving the confirmation email when requesting a new account. Regards, Thomas Wood ___ es-discuss mailing list

re: should we rename the Program grammar production?

2012-10-12 Thread Russ Thomas
list-noob here - I hope this gets threaded ok. One of the pieces of awkward ES specification terminology has been the use of the word Program as the name for a global top-level StatementList. This, I think is what (the noun) program should be reserved for. A ES Program is commonly only a

ES5 question: Error object property 'message' - enumerable or not?

2011-09-03 Thread Thomas L. Shinnick
An issue popped up where V8 recently made everything in Error objects non-enumerable. This was surprising to some apps. More surprising is the insistence that this is required by the ES5 spec. As a simplistic reader, when own property is mentioned here 15.11.2.1 new Error (message)

Re: Array.prototype.indexOf typo

2009-04-08 Thread Thomas L. Shinnick
At 09:53 AM 4/8/2009, James Graham wrote: Unless I am mistaken k is the current array index and n is the initial array index, so the step Repeat while k n is a noop. I presume it should say Repeat while k length Yes, this was changed after the last errata. 15.4.4.14