Results 27 comments of queue
trafficstars

> if more `import`ant use cases arise Ha. Well, in the same vein as `export`'s quasi-commonjs sugar, `import` could become another commonjs sugar similar to ls' `require!`: ``` import #...

``` f a >< b ``` sort of looks like the middle parentheses of ``` ( f a )( b ) ``` if you squint.

How are those examples supposed to desugar? I can sort of see the second one being: ``` js ref$ = /([^a-z]*)([a-z]+)(.*)/.exec(pfxSfxData) prefix = ref$[1] middle = ref$[2] suffix = ref$[3]...

We don't want to pull in an entire library just to enable some sugar. However, the regex proposal is essentially just named capturing groups, right? Thus, it could desugar like...

Here's a more complete desugar proposal for "regex destructuring": ``` coco /prefix(?middle:[a-z]+)suffix/ = prefixSfxData ``` ``` js var middle, ref$; (ref$ = /prefix([a-z]+)suffix/.exec(prefixSfxData), ref$ !== null && middle = ref$[0],...

Feasible, yes, but it also needs to be fast, and since you're trying to unpack binary bits, I imagine speed is of the essence. If a ` = data` syntax...

The only binary unpacking I've ever done with JS are the packed bytes of the [GIF file format](http://www.onicos.com/staff/iz/formats/gif.html#aeb), which are byte-aligned, fixed-width fields. Do you come across variable width and/or...

[Node Buffers are indexed by bytes](http://nodejs.org/api/buffer.html#buffer_buf_index), and ArrayBuffers are indexed by whatever [ArrayBufferView](https://developer.mozilla.org/en-US/docs/JavaScript_typed_arrays/ArrayBufferView) is used. `Uint8Array` would match buffer behaviour there. What I was kind of imagining for this syntax...

For the original use case in this bug, the objective isn't really the soft import, but default "keyword" arguments, which you can kind of get already: ``` coco human =...

Some research: `lexer.co` outputs tokens in the form `[TAG, value, lineNumber]`, which is converted to jison variables in by `coco.co`: ``` coco parser import yy : require \./ast lexer :...