Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    ven
    @vendethiel
    (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
    Cerem Cem ASLAN
    @ceremcem
    or, absolutely:
    x = -> 
      return 
        * a: 1
          b: 2
        * a: 2
          b: 6
    
    x!
    Daniel Rodríguez Rivero
    @danielo515
    I didn't know you can use return, my bad
    Daniel Rodríguez Rivero
    @danielo515
    Hello people
    One small question
    How do you write something similar to JSDocs in livescript ?
    I want to extract documentation from my comments
    Cerem Cem ASLAN
    @ceremcem
    I think there is no way unless a little hack is introduced:
    hello = (x) -> 
        ``
        /**
         * Create a point.
         * @param {number} x - The x value.
         * @param {number} y - The y value.
         */
        ``
        x * 2
    Daniel Rodríguez Rivero
    @danielo515
    But what does that produce ? A function with that string literal inside right ?
    I don't mind to use something different from JSDOCS as long as I can produce documentation from code
    Cerem Cem ASLAN
    @ceremcem
    hmm, I thought you need to use JSDocs... ok
    you are okay with anything that gives you the documentation
    Daniel Rodríguez Rivero
    @danielo515
    Yes I am, but I don't know which tools are available for LS
    Maybe if JSDOC could be configured to decide which comment token to use...
    but anyway, is there a tool for LS ?
    Cerem Cem ASLAN
    @ceremcem
    I'm not using those type of tools, so I don't know. But I'm pretty sure that JSDocs can be used as is
    Daniel Rodríguez Rivero
    @danielo515
    Ok thanks, I'll give it a try !
    Daniel Rodríguez Rivero
    @danielo515
    At the end I had to write a custom JSDOC plugin to make it understand ls files
    Daniel Rodríguez Rivero
    @danielo515
    Here are the requirements to make it work
    Cerem Cem ASLAN
    @ceremcem
    looks promising!
    Cerem Cem ASLAN
    @ceremcem
    1.6.0! :tada:
    ven
    @vendethiel
    :clap:
    cyberco
    @cyberco

    Hey Folks! I didn't know about this room but it's great to see LiveScript is still alive. I've been using it for a number of years now with great pleasure for a lot of projects. So thanks!
    I never dove into the deep implementation details of LiveScript so forget me if I'm asking something newbie. I'm using require as in m = require 'mithril'but now I'd like to switch to the ES6 way with import. One of the reasons being that in a webpack config file this doesn't work:

        new webpack.ProvidePlugin do
            m: 'mithril'

    This is supposedly due to the fact that it's incompatible with require. I'm not so sure, but it got me wondering whether LiveScript compiles to ES5 or something later. As I said, sorry if this is too newbie for you guys. :)

    Antti Korpi
    @anko
    @cyberco ES6 import is not in LiveScript yet. Discussion here: gkz/LiveScript#705 You might want to help test-drive https://github.com/bartosz-m/livescript-transform-esm (which approach is to transform existing livescript code) or https://github.com/dk00/livescript-next (which aims to prototype for a future livescript version).