LiveScript icon indicating copy to clipboard operation
LiveScript copied to clipboard

removing features

Open gkz opened this issue 13 years ago • 54 comments

So far (on master), slated for removal (and currently with compiler notices upon use):

  • short function syntax - f(x) = x - [currently has notice] why: hacky implementation, duplicating functionaly use --> to make curried functions
  • +++ concat op [currently has notice] why: added ++ as concat op, which is shorter and better
  • where statement - relatively useless - just use local var assignment or a let statement [currently has notice]
  • undefined alias for void - added for CoffeeScript compatibility, but with coffee2ls that is not an issue [currently has notice]
  • !? inexistence op [currently has notice]

discussion:

  • choose one of ** or ^ for power op?
  • remove import and importAll?
  • remove x is not y to mean x isnt y, have it mean x is !y instead
  • yes/no/on/off aliases - added for CoffeeScript compatibility, but now with coffee2ls, this is not an issue

More controversial:

  • remove standalone use of @
  • remove standalone or hanging use of ::

gkz avatar Dec 02 '12 16:12 gkz

I like ** more for power op. Maybe remove either . or << ? Not sure about import/importAll, but with implements, it became less useful

Discussion : simplify switch

vendethiel avatar Dec 02 '12 16:12 vendethiel

** has been accepted as the exponentiation operator in CoffeeScript (see jashkenas/coffee-script#2026), definitely go with that. Already implemented in CoffeeScriptRedux at michaelficarra/CoffeeScriptRedux@6bc355d027326d5d1e42650d9178dae8eb5554cf.

michaelficarra avatar Dec 02 '12 17:12 michaelficarra

Also, regarding yes/no/on/off, I actually use yes and no all over the place in my CoffeeScript code. It's probably a 9:1 ratio of yes/no to true/false. They just make more grammatical sense when they're used as the answer to a question.

michaelficarra avatar Dec 02 '12 20:12 michaelficarra

I rarely use import/importAll, much preferring <<< and <<<<

DavidSouther avatar Dec 04 '12 16:12 DavidSouther

import and import all are much more readable and obvious, especially as functions, i.e. map (import a:5).

apaleslimghost avatar Dec 04 '12 17:12 apaleslimghost

yes quarterto..I think the same..import is much more obvious, the livescript syntax is great but it has too much symbols (a good haskell son :D) I'm much more ocaml syntax fan and I think the symbols only are goods when they're used so much or use a keyword could be so long...

I really like ++ for concat over +++ ...

cocodrino avatar Dec 07 '12 22:12 cocodrino

Also thinking of removing inexistance !? as it conflicts with call with no args + existence. Eg. f()? is different that f!?

gkz avatar Dec 30 '12 18:12 gkz

+1. It's a mess and not readable at all.

vendethiel avatar Dec 30 '12 18:12 vendethiel

Also:

  • remove undefined as alias to void
  • remove x is not y to mean x isnt y, have it mean x is !y instead

gkz avatar Dec 30 '12 19:12 gkz

More controversial:

  • remove standalone use of @
  • remove standalone or hanging use of ::

gkz avatar Dec 30 '12 19:12 gkz

I quite like @ when in a call blah(@)... but I see your point. I don't for ::

vendethiel avatar Dec 30 '12 19:12 vendethiel

Standalone use of @:

I regularly use @ standalone at the end of a function to return this;

Hanging :::

I regularly use Type:: <<< to quickly assign several properties to a prototype.


David Souther http://davidsouther.com

On Sun, Dec 30, 2012 at 2:52 PM, George Zahariev [email protected]:

More controversial:

  • remove standalone use of @

  • remove standalone or hanging use of ::

    — Reply to this email directly or view it on GitHubhttps://github.com/gkz/LiveScript/issues/219#issuecomment-11768087.

DavidSouther avatar Dec 30 '12 19:12 DavidSouther

@DavidSouther we have ::= as sugar for .prototype import.

apaleslimghost avatar Dec 31 '12 09:12 apaleslimghost

You learn something new every day! @quarterto Thanks!

DavidSouther avatar Dec 31 '12 15:12 DavidSouther

my 2¢: remove it as automatic assignment to single argument function calls.

Is it just me? When I first saw LiveScript I thought, 'cool, look at all these features', but my second thought was: 'they can't hope to keep more than half of these in the long run'. The problem is I don't know which half. Was that the idea?, to throw everything and see what shakes out?

craigyk avatar Jan 07 '13 17:01 craigyk

A lot is coming from @satyr/coco, and it's been since around two years I think (maybe more ?). These are features thought before by satyr. LiveScript came, added back some coffee compatibility, and of course functional sugar.

vendethiel avatar Jan 07 '13 18:01 vendethiel

Remove with BLOCK, I can't see where you can't do that with do/cascade. The cloneport could maybe be changed to use another keyword ... We have with/when/where, maybe we could avoid having 3 different keywords (when they don't have a so different meaning)

vendethiel avatar Jan 11 '13 15:01 vendethiel

I can't see where you can't do that with do/cascade.

Cascade sometimes is inconvenient as a prog1 due to the requirement of at least one ref in its body (as of satyr/coco#179).

satyr avatar Jan 11 '13 15:01 satyr

why just not use do then ?

a do
  do
    some instructions
    d

Also, LS removed withstatement as argument as per #53 (we have <| do as a replacement)

vendethiel avatar Jan 11 '13 15:01 vendethiel

That's a progn, not prog1.

satyr avatar Jan 11 '13 15:01 satyr

That's a progn, not prog1.

(we have <| do as a replacement)

but I suppose it is inconvenient

vendethiel avatar Mar 10 '13 14:03 vendethiel

remove import and import all?

import/import all is very nice for static mixins (maybe there's a better way?) cf.:

class A extends B implements C
  import all B, C
class A extends B implements C
  @ <<<< B
  @ <<<< C

9:1 ratio of yes/no to true/false

:+1: from ObjC but I see their redundancy.

@ standalone at the end of a function to return this;

:+1:

Remove with BLOCK

:+1: :+1:

texastoland avatar Mar 10 '13 16:03 texastoland

I think the where statement can make better styling when used appropriately.

promise.then resolve, resolve where resolve = (fate) ->

# vs.

resolve = (fate) ->
promise.then resolve, resolve
result.join('&')
  where result = for key, value of data
    switch
    | typeof value in <[ number boolean string ]> => "#{key}=#{value}"
    | value.length => (for item in value => "#{key}=#{item}").join('&')
    | otherwise => ''

# vs.

result = for key, value of data
  switch
  | typeof value in <[ number boolean string ]> => "#{key}=#{value}"
  | value.length => (for item in value => "#{key}=#{item}").join('&')
  | otherwise => ''
result.join('&')

ming-codes avatar Jul 05 '13 07:07 ming-codes

I regularly use @ standalone at the end of a function to return this; import and import all are much more readable and obvious, especially as functions, i.e. map (import a:5). 9:1 ratio of yes/no to true/false

:+1:

And please :smile: let me remind #297:

[...] allowing the use of implements outside class definitions in order to be able to declare functions and variables with the implements id

jorgebg avatar Jul 09 '13 19:07 jorgebg

+1 @lightblade. I also would like to keep where in Livescript, it really helps readability when skimming over code because it moves the important parts of body to the top of function definition. This is like reading an article: the first line should give you a rough idea what a function does and the implementation is followed in case you need to get into the detail.

PkmX avatar Jul 16 '13 18:07 PkmX

Also favoring the removal of on and off for gkz/prelude-ls#55. Personally I haven't found them to be very useful in increasing readability, YMMV. Maybe we can move them to prelude-ls as const on = true and const off = false.

PkmX avatar Jul 16 '13 18:07 PkmX

I share @PkmX and @lightblade POVs on where, so I'm :+1: -ing it here.

robotlolita avatar Jul 16 '13 22:07 robotlolita

I regularly use @ standalone at the end of a function to return this;

I am doing this a lot - allows chaining.

Also using it together with jQuery is quite nice: $(@)

karamfil avatar Jul 25 '13 17:07 karamfil

this standalone allows chaining too

vendethiel avatar Jul 25 '13 17:07 vendethiel

Well, sure, but it's the aesthetic of the bare @ that draws me to it. Three less characters, and it looks like a little hook hanging there at the end of the method, just begging the next coder to hook in to it.


David Souther http://davidsouther.com

On Thu, Jul 25, 2013 at 1:30 PM, Nami-Doc [email protected] wrote:

this standalone allows chaining too

— Reply to this email directly or view it on GitHubhttps://github.com/gkz/LiveScript/issues/219#issuecomment-21570515 .

DavidSouther avatar Jul 25 '13 17:07 DavidSouther