Re: Adding .map() directly to String prototype

2018-05-17 Thread Scott Sauyet
On Thu, May 17, 2018 at 11:16 AM, Ben Fletcher wrote: > Consider adding the array .map() implementation directly to the String > prototype. There is a big difference between mapping over an array and mapping over a string. Arrays can hold *anything*. Strings hold only

Re: Function composition vs pipeline

2018-03-15 Thread Scott Sauyet
I would probably structure this so differently that it's hard to even say where the changes should be. I don't know the Electron API, so the following is almost certainly wrong, but it should demonstrate the basic ideas: ``` const promisify = require('some-promisify-function'); const

Re: Determining if an object can be constructed

2017-01-20 Thread Scott Sauyet
Bradley Meck wrote: >> 1. every call to `new Foo(...args)` creates a distinct object not >> reference-equal to any other such call. > > Would this mean > > ``` > function factory() { return []; } > ``` > > would qualify as a constructor? I'm thinking of that as a necessary, but not a sufficient

Re: Determining if an object can be constructed

2017-01-20 Thread Scott Sauyet
Bradley Meck wrote: > I am unsure the exact question. I certainly agree that it's not a well-formulated question. Perhaps in the end it's not even coherent. But it seems to make some sense. I suspect that the answer is simply that it cannot be done. But I don't know how to demonstrate that.

Re: Determining if an object can be constructed

2017-01-19 Thread Scott Sauyet
Michael Haufe wrote: > The question came up recently on CLJS [1] on how to determine if an object > is safe to call as a Constructor. The original question was a response to || You cannot determine whether a function can be called as a constructor || unless you try

Re: Re: Property ordering of [[Enumerate]] / getOwnPropertyNames()

2015-09-02 Thread Scott Sauyet
John-David Dalton wrote: > It's odd to me that: > > Reflect.ownKeys() has defined order but > Reflect.enumerate() doesn't > > I'm using Reflect.enumerate() to create a `keysIn` implementation (like > `keys` but for own & inherited key > names). > > :+1: for more

Re: The Tragedy of the Common Lisp, or, Why Large Languages Explode (was: revive let blocks)

2015-06-19 Thread Scott Sauyet
Greg McLeod cle...@gmail.com wrote: I really really love JS (it's so fun!), and while there are many features in ES6 that I think are great (such as classes, modules, and import syntax) there are things that quite frankly scare me quite a bit. Such examples include destructuring and arrow

Re: Nailing object property order

2015-04-16 Thread Scott Sauyet
I don't have pointers to other es-discuss threads where this was mentioned, but I do have a reason of my own for wanting this. I started and help maintain Ramda [1], a functional programming library for ES. It is a collection of utility functions similar in scope to Underscore or lodash,