Re: non-self referencial cyclical promises?

2016-02-24 Thread Kris Kowal
With Mark’s direction, the v2 branch of Q handles "vicious cycles" through the WeakMap that maps promises to their underlying handler. Whenever a promise is resolved with another promise, it walks forward through the chain of promises that the promise handler "became" through resolution. The first

Re: `await null` to stay in the same tick?

2016-02-07 Thread Kris Kowal
Await yields to the event loop unconditionally. This is useful for spreading CPU-bound work across multiple events. You can explicitly await conditionally. ``` if (guard) { await guard; } ``` On Sun, Feb 7, 2016 at 1:39 PM /#!/JoePea wrote: > I'm not sure where's the best

Re: Return value of forEach

2015-10-16 Thread Kris Kowal
var iterator = range(0, 10, 1); var iterations = iterator.forEach((x) => console.log(x)); console.log(iterations); ``` Kris Kowal On Fri, Oct 16, 2015 at 7:30 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > That's usually a made-up issue ... the example code is using two

Re: RegExp.escape

2015-06-12 Thread Kris Kowal
I believe you need to champion the issue. Create a Github repository and start editing the fragment of the spec. I do not believe that the issue is contentious. The color of the shed is obvious. The only thing missing is a champion willing to do the writing. On Fri, Jun 12, 2015 at 10:52 AM,

Re: Integrating the Webs' dependency systems

2014-05-27 Thread Kris Kowal
compatible with npm. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Integrating the Webs' dependency systems

2014-05-27 Thread Kris Kowal
On Tue, May 27, 2014 at 3:04 PM, Ian Hickson i...@hixie.ch wrote: On Tue, 27 May 2014, Kris Kowal wrote: It would be lovely if HTML could be trained to resolve URL's through the module system. By HTML here I presume you mean the underlying Fetch mechanism. Could you elaborate on exactly how

Re: Array.prototype.last()

2014-05-13 Thread Kris Kowal
. http://documentup.com/montagejs/frb/#tutorial/last Kris Kowal On Tue, May 13, 2014 at 11:54 AM, Dmitry Soshnikov dmitry.soshni...@gmail.com wrote: Hi, Exactly at the moment I'm writing too many of entries[entries.length - 1] where `entries` is an array (with of course moving to a helper

Re: RegExp.escape

2014-03-21 Thread Kris Kowal
Continuing a 2 year old thread. http://esdiscuss.org/topic/regexp-escape ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Promise.cast and Promise.resolve

2014-01-28 Thread Kris Kowal
In this case, a half pursuit of type purity is a side quest at the expense of users. Having two ways to resolve and two ways to observe a promise is unnecessarily confusing. In my experience, one method like then, that unwraps recursively, and one function, like Promise.cast, that automatically

Re: Weak callbacks?

2013-11-12 Thread Kris Kowal
do find a promise inspector compelling, one that will show an error until it is handled, but even in this case, I think it is compelling to visually elevate an unhandled error to a provably never-to-be-handled error, and this is not possible, at least outside chrome-space, without WeakRef. Kris

Re: Promises: final steps

2013-09-04 Thread Kris Kowal
-origin iframes, and even show time sequence / Stevens graphs for message passing between promises in multiple JavaScript contexts, when promises are used as proxies for remote objects through a facility like Q-Connection https://github.com/kriskowal/q-connection Kris Kowal

Re: Optionally ignoring case in String.prototype.contains()?

2013-08-28 Thread Kris Kowal
Perhaps the second argument of `contains`, `startsWith`, and `endsWith` should be consistent with the second argument of the `RegExp` constructor. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Optional Strong Typing

2013-08-23 Thread Kris Kowal
and proposals that came out of these discussions. I believe it is fair to interpret Brendan’s last sentiment, “This again puts unsound warning types outside of the standards track for a while. But carry on with TypeScript etc. — TC39 is tracking”, not as “no”, but as “not yet”. Kris Kowal

Re: July notes: copySlice -- copyWithin ??

2013-08-14 Thread Kris Kowal
not be perturbed by `copy` and `clone` coexisting as such. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: SortedArray in JavaScript?

2013-08-11 Thread Kris Kowal
On Sat, Aug 10, 2013 at 3:19 AM, Forbes Lindesay for...@lindesay.co.uk wrote: I doubt you want to let it be indexed using `[]` and I see little reason why it would need to be built into the language. It would make far more sense as a nice little library, which creates a much smaller maintenance

Re: [Map/Set] Add an .update() method, a la Python?

2013-06-27 Thread Kris Kowal
I’ve found it satisfyingly idiomatic to call this `addEach` (for both maps and other collections) in my work on Collections[1]. [1]: https://github.com/montagejs/collections ___ es-discuss mailing list es-discuss@mozilla.org

Re: Where'd Promise#done go?

2013-06-18 Thread Kris Kowal
both old and new engines, the promise polyfill will simply have to patch a no-op done onto the engine’s Promise.prototype. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: The Paradox of Partial Parametricity

2013-05-22 Thread Kris Kowal
it be more clear that it is intended for monadic composition if the name were literally bind? Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Do futures represent a pipeline? (was Re: Future cancellation)

2013-05-01 Thread Kris Kowal
/design/README.js Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: WeakMap better than Private Symbols? (was: direct_proxies problem)

2013-01-10 Thread Kris Kowal
in the Mozilla Add-on toolkit, but the links have gone stale. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Designing a MultiMap (in DOM, would like to be consistent with ES)

2012-11-30 Thread Kris Kowal
use case, this loses information about interleaving of keys, which is usually unimportant except (perhaps) in making round trips between parse and stringify. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo

Re: [Bug 20019] Support subclassing ES6 Map

2012-11-20 Thread Kris Kowal
On Tue, Nov 20, 2012 at 10:57 AM, Mark S. Miller erig...@google.com wrote: Since Map and Set will be in ES6 and MultiMap is trivially implementable from these, we can wait until we see some experimental implementations before standardizing. Hence the ES7 target. Here’s my experimental

Re: Map.prototype.clear method

2012-10-22 Thread Kris Kowal
. https://github.com/kriskowal/collections Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: global object in strict mode

2012-08-24 Thread Kris Kowal
? CSP does forbid the Function constructor, by the edict “Code will not be created from strings”. http://www.w3.org/TR/CSP/ Section 4.2 “If unsafe-eval is not allowed…” Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: Protected Protocol

2012-04-03 Thread Kris Kowal
namespaces, and how a namespace can have a common ancestor prototype for each instance. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Array#sort(prop)

2012-04-01 Thread Kris Kowal
({by:relation}) values.sort({by:relation,compare:altCompare}) values.sort({compare}) // if default compare is added in global scope values.sort({}) // default comparator Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: Set polyfill with a has method more efficient than O(n)

2012-03-30 Thread Kris Kowal
datastructure, an object that maps consistent hashes - to array buckets - to values for Set or [key, value] pairs for Map. I would also implement Map in terms of Set, just overriding the hash and equals functions to operate on the key portion of each pair in the set. Kris Kowal

Re: simpler, sweeter syntax for modules

2012-03-21 Thread Kris Kowal
On Wed, Mar 21, 2012 at 4:05 PM, Axel Rauschmayer a...@rauschma.de wrote: Honest question: Are nested modules really needed? There is a chance that they would be useful for bundling. Modules can’t be concatenated. Kris Kowal ___ es-discuss mailing

Re: How about replacing | with -

2012-03-02 Thread Kris Kowal
make sense as an alternative to +, where the result shadows instead of snapshots the left hand side for the same effect until it changes. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: RegExp.escape()

2012-01-04 Thread Kris Kowal
On Sun, Jun 13, 2010 at 7:50 AM, Jordan Osete jordan.os...@yahoo.fr wrote: Hello everybody. How about standardizing something like RegExp.escape() ? http://simonwillison.net/2006/Jan/20/escape/ It is trivial to implement, but it seems to me that this functionality belongs to the language -

Re: WeakMaps question ?

2011-11-11 Thread Kris Kowal
where items are explicitly collected. http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets As I recall, a variant of Map was considered in the ES4 timeline as well. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Minimal type guards?

2011-10-13 Thread Kris Kowal
, separating the signatures from the declarations. Alex’s question is whether some subset of these ideas is suitable for rapid consensus. I will refrain from speculating. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: That hash symbol

2011-03-25 Thread Kris Kowal
, but it is true. I also want to see careful and well-wrought steady progress. I remember a former decade when this discussion was impossible to follow, too many bad ideas were too thoroughly discussed, and much time was wasted. Kris Kowal ___ es-discuss

Harmony as a Compilation Target of my Dreams

2011-02-08 Thread Kris Kowal
cost. A third use-case would be annotating the sources of statically bundled Simple Modules or whatever succeeds them. I imagine that there would be a need for tools that transform load directives into inline modules, so it would be handy to annotate sources for debugging in that case too. Kris Kowal

Re: Harmony as a Compilation Target of my Dreams

2011-02-08 Thread Kris Kowal
position back to original text position. And I find HOBD's use of # much more valuable. I do not think we should have both uses of # coexist in one language. Ah. With these givens, I agree. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org

Re: idea: try/catch and rethrow...?

2011-02-01 Thread Kris Kowal
. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Simple Modules: lazy dependency evaluation

2011-01-27 Thread Kris Kowal
method proposed in Simple Modules for deterministically linearizing the evaluation order? Non-determinism is definitely a greater evil than providing developers a means to explicate the order in which they would like their side-effects to be wrought. Kris Kowal

Re: Simple Modules: lazy dependency evaluation

2011-01-27 Thread Kris Kowal
that there are no files that would be loaded that are not reachable through transitive load directives. I suppose I've answered my question, if all my assumptions are correct. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: New private names proposal

2010-12-16 Thread Kris Kowal
] = y;    } I tend to disagree with most developers, so take it with a grain of salt that I find the latter form, with all the implied abilities, easier to understand. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: simple shorter function syntax

2010-07-23 Thread Kris Kowal
there would be resistance to looking ahead. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Composition of Uncoordinated Working Sets of Modules

2010-06-07 Thread Kris Kowal
On Mon, Jun 7, 2010 at 8:37 AM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Sun, Jun 6, 2010 at 2:00 PM, Kris Kowal kris.ko...@cixar.com wrote: ... Most of this is good clarification, particularly that load interacts with the exports of the foreign script's implied, anonymous module scope

Re: Composition of Uncoordinated Working Sets of Modules

2010-06-07 Thread Kris Kowal
On Mon, Jun 7, 2010 at 12:10 PM, Erik Arvidsson erik.arvids...@gmail.com wrote: On Mon, Jun 7, 2010 at 10:35, Kris Kowal kris.ko...@cixar.com wrote: Another thing that Ihab clarified which merits a full section on the wiki is the dynamic scoping of lexical module names. This is a common

Re: Composition of Uncoordinated Working Sets of Modules

2010-06-06 Thread Kris Kowal
/aQuery.js); const $ = aQuery_.aQuery.$; Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Composition of Uncoordinated Working Sets of Modules

2010-06-05 Thread Kris Kowal
On Sat, Jun 5, 2010 at 3:40 AM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Fri, Jun 4, 2010 at 9:48 PM, Kris Kowal kris.ko...@cixar.com wrote: On Fri, Jun 4, 2010 at 5:17 PM, David Herman dher...@mozilla.com wrote: By keeping modules second class, we get a number of benefits, not just

Re: Composition of Uncoordinated Working Sets of Modules

2010-06-05 Thread Kris Kowal
we need both layers. Meanwhile, I would still like to see examples of how to compose working sets of modules with other working sets of modules that were not designed in coordination. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https

Composition of Uncoordinated Working Sets of Modules

2010-06-04 Thread Kris Kowal
constructing applications and APIs by composing non-coherent groups of name spaces produced by non-cooperating groups of developers. In any case, that's my two bucks, Kris Kowal [1] http://wiki.commonjs.org/wiki/Packages/Mappings/B [2] http://limi.net/articles/resource-packages/ [3] http

Re: Composition of Uncoordinated Working Sets of Modules

2010-06-04 Thread Kris Kowal
(1).join(/)); } }) I think it might be best to organize the syntax around MRL's rather than local short-names. MRL's can be reasonably short if they're permitted to be relative paths, which requires the module loader handler to receive the MRL of the requesting module. Kris Kowal

Re: Modules: Name capture

2010-06-02 Thread Kris Kowal
be the norm, and explicit linking can at least be deferred to the layer of packages, or coherently designed sets of modules linking to other coherently designed sets of modules. I presume that it is possible to isolate and explicitly link groups of modules. Kris Kowal

Re: Tech talk on proxies and traits

2010-05-01 Thread Kris Kowal
properties, but that would preclude meta-object hierarchies. I suspect that these will be desirable and that exposing the base handler prototype would be useful. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: Tech talk on proxies and traits

2010-05-01 Thread Kris Kowal
getting such deeply detailed attention. Thanks. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

forEach on next

2010-03-28 Thread Kris Kowal
[moving this thread onto es-discuss] On Tue, Mar 23, 2010 at 2:45 PM, Brendan Eich bren...@mozilla.org wrote: On Mar 23, 2010, at 2:17 PM, Kris Kowal wrote: Aside: I hope we can resolve MarkM's suspicions of composability problems with generators; they are one of my very favorite features

Re: simple modules

2010-02-04 Thread Kris Kowal
the context, in which case it would be appropriate to call the entire entity a Context. However, I think that for the purpose of this discussion, it is desirable to separate the layers and concerns so that we can see the breadth of options. Kris Kowal [1] http://wiki.commonjs.org/wiki/Modules/Transport

Re: simple modules

2010-02-03 Thread Kris Kowal
On Wed, Feb 3, 2010 at 12:39 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 2, 2010, at 6:23 PM, Kris Kowal wrote: This verbiage implies black-listing.  It would be good to be clear that the object formerly known as a module context should be explicitly populated with a white-list

Re: simple modules

2010-02-02 Thread Kris Kowal
Would someone mind posting a summary of the current positions of the active participants of this discussion, perhaps contrasting the proposals? Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: simple modules

2010-02-02 Thread Kris Kowal
this proposal suggest that there is exactly one Context for every Sandbox and that any module block statement evaluated in a context populates the corresponding sandbox with a mapping from the given module identifier to the first class exports object of that module? Kris Kowal

Re: typed array strawman proposal

2010-01-26 Thread Kris Kowal
. I think the various aligned typed arrays are a good idea, but I think CommonJS would be satisfied if we were to agree on the byte array buffer type initially. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo

Re: quasi-literal strawman

2009-12-17 Thread Kris Kowal
for numbers, in suffix. For example: 3ce for thrice or 1mm for one millimeter, where ce and mm were constructors in scope. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Binary Data - possible topic for joint session

2009-11-14 Thread Kris Kowal
you have the luxury of specifying [[Get]] and [[Put]]. The .get method in the CommonJS proposal is intended to serve as a stop-gap for implementations that cannot provide properties. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https

Typo in Annex E

2009-11-14 Thread Kris Kowal
The last paragraph of Annex E notes that getPropertyName is among the divergences from ES3. I presume this is intended to be getPropertyNames with plural infection. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Hermetic Evaluation, Modules Strawman

2009-09-30 Thread Kris Kowal
, we can do a lot in libraries without native language support so it's worth kicking off a discussion around that feature early. Kris Kowal [1] http://wiki.ecmascript.org/doku.php?id=strawman:modules [2] http://wiki.commonjs.org/wiki/CommonJS [3] http://narwhaljs.org/ [4] http://wiki.commonjs.org

Re: Spawn proposal strawman

2009-05-21 Thread Kris Kowal
options for producing the desired performance. It might be better to have a compile() routine that returns an opaque, engine-specific Program object that can in turn be executed multiple times. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org

Re: Spawn proposal strawman

2009-05-12 Thread Kris Kowal
On Mon, May 11, 2009 at 4:21 PM, Brendan Eich bren...@mozilla.com wrote: On May 11, 2009, at 4:10 PM, Kris Kowal wrote: Perhaps I'm behind on the times, but I'm under the impression that presently the behavior of this function foo declaration has no standard behavior: (function

Re: Spawn proposal strawman

2009-05-11 Thread Kris Kowal
On Mon, May 11, 2009 at 9:26 AM, Brendan Eich bren...@mozilla.com wrote: On May 8, 2009, at 8:49 PM, Kris Kowal wrote: (function (require, exports) { + text + /**/\n} Nit-picking a bit on names: require : provide :: import : export -- so mixing require and export mixes metaphors. Never stopped

Re: Spawn proposal strawman

2009-05-08 Thread Kris Kowal
hope we can provide a switch on the sandbox machinery so the application programmer can chose whether they want light-weight sandboxes or heavy ones. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: Universal Feature Detection

2009-04-29 Thread Kris Kowal
testing system for layout, rendering, event, and other features and quirks that might not be neatly distinguished based on the availability of a module. Kris Kowal ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: Remarks about module import

2008-08-23 Thread Kris Kowal
great hope for the fruit of this discussion. Kris Kowal ___ Es-discuss mailing list Es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Remarks about module import

2008-08-23 Thread Kris Kowal
; }; index.js from ./sink.js import sink; // or let sink = require(./sink.js).sink; from http://jquery.com/dist/jQuery.10.1.js; import jQuery as $ from ./my-widget.js import MyWidget sink($('#widget'), MyWidget()); Kris Kowal ___ Es-discuss mailing