Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Cerem Cem ASLAN
    @ceremcem
    As livescript.net says, just like normal functions if you supply all arguments and just like factory functions, if you supplied the arguments partially:
    add = (a, b) --> a + b 
    add-five = add 5
    add-five 3  # => 8
    add 4, 7  # => 11
    add 4 7   # => 11
    but I never use curried functions. they scares me out.
    what is your exact use case issue?
    Daniel Rodríguez Rivero
    @danielo515
    Almost all my functions are curried
    ONLY curried
    I mean, you can not make add(1,2) and add(1)
    I don't want automatically curried functions
    Just unary ones
    This will be the actual signature add = a -> b -> a + b
    This works
    add = a -> b -> a + b 
    
    (add 1) 3
    but the calling is ugly as hell
    :smile:
    Cerem Cem ASLAN
    @ceremcem

    but the calling is ugly as hell

    do you mean (add 1) 3 is ugly? if so, why not simply write add 1 3?

    Daniel Rodríguez Rivero
    @danielo515
    Just look at the function declaration, I can't call it that way ecause it actually returns a function, it does not takes two arguments
    Cerem Cem ASLAN
    @ceremcem
    hm, correct. why do you avoid add = (a, b) --> a + b declaration?
    Daniel Rodríguez Rivero
    @danielo515
    Because the root of all evil, optimization :smile:
    I want to avoid the overhead of curry
    Daniel Rodríguez Rivero
    @danielo515
    Hello
    Is anyone using livescript-next ?
    Any idea how can I use it to compile my source files ?
    Cerem Cem ASLAN
    @ceremcem
    I'm still using 1.4
    Daniel Rodríguez Rivero
    @danielo515
    Hahaha, actually I'm using livescript 1.5,but I was asking about a side project that transforms livescript ast to babel ast
    So you can take advantage of all the babel ecosystem
    I've been able to write a simple compiler, but there should be a better way
    They have instructions for running code, but not for compiling code
    The only reference to compiling is a single line about their api, which is what I'm using to build the dummy compiler
    ven
    @vendethiel
    @ceremcem I'm not sure I'd say I'm "actively working on types". I think we're going to tank @rhendric's branch, because my idea is somewhat stuck in limbo
    (requires heavy amount of backtracking)
    (sorry, I hadn't opened gitter in ages)
    Daniel Rodríguez Rivero
    @danielo515
    Hello, can someone tell me how can I make a function that returns an object ?
    Actually an array of objects
    The only body of the function is the array return
    Cerem Cem ASLAN
    @ceremcem
    seriously? did you take a look at livescript.net for that?
    ven
    @vendethiel
    listar, [], whatever floats your boat
    Cerem Cem ASLAN
    @ceremcem
    @vendethiel I thought you proceeded very well on types. I feel a little bit guilty because of being out of the development effords
    ven
    @vendethiel
    I think we're going to go with @rhendric's implementation of my earlier proposal, though
    I liked the last syntax I proposed, but... the backtracking isn't worth the gains. sigh
    Daniel Rodríguez Rivero
    @danielo515
    seriously? did you take a look at livescript.net for that?
    Yes, seriously
    I opened an issue in fact and seems to be a bug
    Its not possible
    Cerem Cem ASLAN
    @ceremcem
    LiveScript 1.4.0 - use 'lsc --help' for more information
    ls> x = -> {hello: \there}
    [Function: x]
    [Function: x]
    ls> x!
    { hello: 'there' }
    ls>
    what part may I misunderstand?
    Daniel Rodríguez Rivero
    @danielo515

    what part may I misunderstand?

    Sorry, not concrete enough I think:

    x = -> 
       * a: 1
          b: 2
       * a: 2
          b: 6
    I want to return an array of objects
    Cerem Cem ASLAN
    @ceremcem
    x = -> 
      hello = 
        * a: 1
          b: 2
        * a: 2
          b: 6
    
    x!
    Daniel Rodríguez Rivero
    @danielo515
    Yes, that is wat I did
    But it makes no sense to declare a variable that is not going to be used in any way