-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removing features #219
Comments
I like ** more for power op. Discussion : simplify switch |
|
Also, regarding |
I rarely use |
|
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 +++ ... |
Also thinking of removing inexistance |
+1. It's a mess and not readable at all. |
Also:
|
More controversial:
|
I quite like |
Standalone use of I regularly use Hanging I regularly use David Souther On Sun, Dec 30, 2012 at 2:52 PM, George Zahariev
|
@DavidSouther we have |
You learn something new every day! @quarterto Thanks! |
my 2¢: remove 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? |
A lot is coming from @satyr/coco, and it's been since around two years I think (maybe more ?). |
Remove |
Cascade sometimes is inconvenient as a |
why just not use a do
do
some instructions
d Also, LS removed withstatement as argument as per #53 (we have |
but I suppose it is inconvenient |
class A extends B implements C
import all B, C class A extends B implements C
@ <<<< B
@ <<<< C
👍 from ObjC but I see their redundancy.
👍
👍 👍 |
I think the
|
👍 And please 😄 let me remind #297:
|
|
Well, sure, but it's the aesthetic of the bare David Souther On Thu, Jul 25, 2013 at 1:30 PM, Nami-Doc [email protected] wrote:
|
Another +1 for bringing back |
I'm thinking of removing both |
remove unjoined strings |
I never use I generally prefer not using symbols if i don't have to... Not all symbols in LS have such quirky and placement specific behavior but i still prefer not to be clever just for saving a few characters. |
I use |
@igl There's no need for decorators in LiveScript outside of changing property descriptors. You can use plain functions for nearly every use case. (I've used this in my own pet projects before) inc = (f) -> ->
@index += 1
f.apply @, &
class Foo
-> @index = 2
foo: inc -> console.log "#{@index}"
wrap = (f) -> -> new List f.apply @, &
class List
(@value) ->
map: wrap (f) -> [f i for i in @value]
filter: wrap (f) -> [i for i in @value | f i]
each: (f) -> [f i for i in @value]; @ |
And things that I wouldn't mind if they were removed:
I do enjoy the |
great list ... I've never tried I will admit I've used so yeah, I'm totally +1 for all that. |
@heavyk I've used that quite a bit, too, but it tends to throw me a little at first glance, which isn't nice when you're reading code. That's why I put it on there. |
Literal overloading in general. It'd make sense to have such feature with a type system (and overloadable operators...), but for us right now... |
@vendethiel +1 |
@IMPinball yea I agree. I had a phase where I wrote a bunch of console apps, and I used that operator all the time. I look at that code now, it's like 'wat??' |
I only disagree with
|
I never used that, what does it do? |
Function composition from right to left. ls> (+ 1) . (* 2) <| 1
3 By the way I find this discussion valuable. LS has a bit too many features. p.s. let's get rid of |
oh, I didn't know you could do that! I just looked at your profile, then at the ramda-cli you're working on, and it gave me a good idea. why do we pass options objects around at all? why not pass around option thunks? every part of anything we write could be composed. I'll give an example... resizeImage({ so I pass in my options object with values, but if I were to instead pass thunks, I could get two objects that can always change, but depend on each oher. one obj would have the thunks to call of the other object, and vice versa.. objects would turn out the properties of other objects. it looks in my head like water. I need a better way to express this. I will work on this more... totally had no idea about those function compositions. whole new world just opened... omg |
@homam To be fair, I have used it before. I have run into a gotcha with it, though: partially applying it. I have found a few times where I had to use Here's a use case for function composition: making a lazy chain: a = -> [.. for &]
chain-sync = a >> reduce (>>)
read-rc = chain-sync do
('.'+)
(fs.read-file-sync _, 'utf8')
JSON.parse I've also used a similar trick in a Gulpfile: require! { /* ... */ }
a = -> [.. for &]
pipe = a >> reduce (a, b) -> a.pipe b
gulp.task \build ->
pipe do
* gulp.src 'src/**/*.ls'
* sourcemaps.init!
* livescript!
* soucemaps.write!
* gulp.dest 'dest' Doing the same with promises is easy a = -> [.. for &]
pipe = a >> reduce (a, b) -> a.then b
my-package-setting = pipe do
* fs.get-file-async 'package.json', 'utf8'
* JSON.parse
* (.'my-custom-setting') |
@raine I use export const method = f => function (...args) {
return f(this, ...args);
};
const each = (xs, f) => {
for (let i = 0; i < xs.length; i++) {
f(xs[i], i);
}
};
export const then = method((x, f) => f(x));
export const match = method((value, pairs) =>
each(pairs, (p, i) => assertCallable(p[0], `test[${i}]`))::then(() => {
let def = Array.isArray(pairs[pairs.length - 1]) ? pairs.pop() : undef;
assertCallable(def, 'def');
for (let [g, run] of pairs) {
if (typeof g === 'function' ? g(value) : value === g) return run(value);
}
return def(value);
});
value::match([
// I found the common case to be a function call with `value`, so I designed
// it with that in mind
[test, value => doSomething(value)],
[otherTest, doSomethingElse],
value => def(value), // optional
]); The last part in LS would be this: match value
| test => doSomething value
| otherTest => doSomethingElse value
| otherwise => def value I enjoy |
@IMPinball I enjoy I am very curious about how these changes are going to land. Will there be a 1.5 with breakage? |
That LS2 branch/roadmap is years outdated. LiveScript uses its own lexer As for an actual roadmap, I don't think there's much to add right now. But On Tue, Jun 16, 2015, 06:45 Richard [email protected] wrote:
|
Match is a must have feature |
+1 on all except stand alone |
I'm disappointed the single-item array not evaluating to an array "feature" wasn't removed in 1.5 after all. 😕 It's something that actively causes pain through unexpected behavior, rather than just duplicating behavior. |
So far (on master), slated for removal (and currently with compiler notices upon use):
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 forvoid
- added for CoffeeScript compatibility, but with coffee2ls that is not an issue [currently has notice]!?
inexistence op [currently has notice]discussion:
**
or^
for power op?import
andimportAll
?x is not y
to meanx isnt y
, have it meanx is !y
insteadyes/no/on/off
aliases - added for CoffeeScript compatibility, but now with coffee2ls, this is not an issueMore controversial:
@
::
The text was updated successfully, but these errors were encountered: