Questions tagged [livescript]

LiveScript is a language which compiles to JavaScript. It is a fork of Coco which is in turn derived from CoffeeScript.

LiveScript is a language which compiles to JavaScript. It is a fork of Coco which is in turn derived from CoffeeScript. Like those two it has a relatively straightforward mapping to JavaScript. LiveScript is Coco but much more compatible with CoffeeScript, more functional, and more feature rich. LiveScript aims for increased expressiveness and code beauty. While adding features to assist in functional style programming, LiveScript also deeply supports imperative and object oriented programming, and has an optional class system with inheritance, calls to super, and more.

Official livescript site: http://livescript.net

67 questions
1
vote
2 answers

Javascript to Livescript conversion; issue with js2ls?

I'm trying to convert the following JS text book example into Livescript: function cf(){ var result = new Array(); for (var i=0; i < 10; i++) { result[i] = function(num){ return function(){ return…
user1860288
  • 512
  • 2
  • 6
  • 18
1
vote
0 answers

How can I add .livescript support to a em or meteor-generate?

em seems to have support for CoffeeScript but not for LiveScript, how can I add that? and secondly which scaffolding tool will be best for building Meteor applications, em or meteor-generator or maybe any other out there? thanks
israrWZ
  • 35
  • 5
1
vote
2 answers

how to use a Gruntfile.ls (livescript Grunt)

I want to write my Gruntfile.js with livescript. I've done Gruntfile.js and Gruntfile.coffee which both work out of the box Gruntfile.ls should work... right? I've seen a few Gruntfile.ls online or does it need to be compiles (other than a .coffee…
user950658
1
vote
1 answer

livescript/prelude: repeat is not defined

With prelude.ls in livescript, when I run repeat 4 'a', it gives me repeat is not defined, all other function works fine. Encountering the same problem on livescript.net, I guess I missed something simple, what is it?
muyueh
  • 1,018
  • 13
  • 16
1
vote
2 answers

LiveScript with Meteor.js

I wonder if there is an easy way to get LiveScript files compiled to js in Meteor.js app. Found this mrt extension: https://atmosphere.meteor.com/package/livescript-latest But doing mrt add livescript-latest only gives error: While building package…
Alexander Savin
  • 6,202
  • 3
  • 29
  • 41
1
vote
1 answer

Livescript's clone operator ^^ doesn't work in the server side (node.js)

In livescript, we can use ^^ to clone an object. For example, consloe.log (^^{a:1}) will be compiled to // Generated by LiveScript 1.2.0 (function(){ console.log(clone$({ a: 1 })); function clone$(it){ function fun(){} fun.prototype…
waitingkuo
  • 89,478
  • 28
  • 112
  • 118
1
vote
2 answers

How to pass yeoman prompt options through to templated files?

I'm writing a version of generator-angular with extra options to support sources in livescript, and bootstrap with less, font-awesome etc. Work in progress is at https://github.com/gmp26/generator-angular-ls I'm hung up on a trivial wish. I'd like…
grumplet
  • 285
  • 2
  • 14
1
vote
2 answers

Browserify a mix of coffeescript and livescript files

I have a main coffee file and a mix of other coffee and livescript files. # main.coffee require 'LiveScript' one = require './one.coffee' two = require './two.ls' console.log one.fun(), two.fun() # one.coffee module.exports.fun = -> 1 #…
Adam Schmideg
  • 10,590
  • 10
  • 53
  • 83
1
vote
1 answer

Coco to LiveScript migration

I am migrating a small script from coco to LiveScript: D = (obj, l = 20) -> if (l > 0) new @[k] = (try D(v, l - 1) catch (e) e) for k, v in obj else obj This code, which is valid in coco, does not compile in LiveScript: Parse…
TN.
  • 18,874
  • 30
  • 99
  • 157
1
vote
1 answer

Shell command execution

I'm trying to implement shell command execution I found here: node.js shell command execution So I'm trying to get second answer (by Chris Eineke) working. But for now I get no output. Here is my try: run_cmd = (cmd, args, done) -> spawn =…
cnd
  • 32,616
  • 62
  • 183
  • 313
1
vote
1 answer

Clear a variable before every controller call in AngularJS?

How can I set some model/variable before every controller call? Currently I have the following service to help me set error messages on the page (code in LiveScript): angular.module "project.services", .factory "Message", ($rootScope) -> { …
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
1
vote
1 answer

AngularJS not recognizing LiveScript's controller

No idea what is going on here! I keep getting the error: Error: Argument 'TasksController' is not a function, got undefined at qa (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js:16:79) at ra…
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
0
votes
1 answer

(Angular) Simple nested views not working

I'm studying Angular, and I'm stuck with ui-router. Here is the code. I'm using PUG & Livescript, I doubt that I'm having issue because of these two. My codes are similar to some answers here in stackoverflow, but I can't make it to work.…
CRIS
  • 335
  • 3
  • 17
0
votes
0 answers

writeFileSync producing 0 bytes file - random

A call to writeFileSync is producing a 0 bytes file at random. The aim is to write a json to a file, then re-write it every time the json changes. And also load the json on startup. But the file keeps becoming 0 bytes long, most of the time it…
eddyparkinson
  • 3,680
  • 4
  • 26
  • 52
0
votes
1 answer

Generate same number each time a function is called

I have a class (LiveScript) that is instantiated once, but its render method is called many times. Each object created in the render method must have a unique key that stays the same across all invocations of render: class Test -> …
Berco Beute
  • 1,115
  • 15
  • 30