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
0
votes
1 answer

How to translate this GorillaScript into LiveScript?

I have this GorillaScript code to flatten arrays: Array::compact := # for filter value in this value and (typeof value.isempty != 'function' or not value.isempty()) and (typeof value != 'object' or Object.keys(value).length !=…
Sod Almighty
  • 1,768
  • 1
  • 16
  • 29
0
votes
4 answers

passing anonymous functions as parameters in livescript

What's the correct way to pass a function as a parameter in liveScript? For instance, lets say I Want to use the array reduce function, in convectional javascript I would write it as the following myArray.reduce(function (a,b) {return a + b}); This…
Sam
  • 1,315
  • 2
  • 13
  • 27
0
votes
1 answer

Livescript: AudioContext can't get defined

I'm trying to load audio with XMLHttpRequests and AudioContext, my code looks like this: class AudioExample audioContext: null init: -> AudioContext = window.AudioContext || window.webkitAudioContext @audioContext = new…
user3946265
0
votes
2 answers

Avoiding left recursion in parsing LiveScript object definitions

I'm working on a parser for LiveScript language, and am having trouble with parsing both object property definition forms — key: value and (+|-)key — together. For example: prop: "val" +boolProp -boolProp prop2: val2 I have the key: value form…
0
votes
2 answers

Livescript. require! and execute

How do I do something that transpiles into this: var foo = require('foo')() Doing that doesn't work: require! { \foo ! } of course I can run it right after the require!, but I was hoping for a shorter form
iLemming
  • 34,477
  • 60
  • 195
  • 309
0
votes
1 answer

LiveScript API-Doc creation?

With JavaScript I used JSDuck, what should I use for LiveScript? Seems like comments aren't preserved in the JS-source.
K..
  • 4,044
  • 6
  • 40
  • 85
0
votes
1 answer

LiveScript's "require 'mymodule'" is not working in browser

I need to modularize my LiveScript project just like prelude-ls project does. Here is my test project: git clone https://bitbucket.org/ceremcem/livescript-module-test In the Readme.md I included the steps to reproduce the problem: Run server…
ceremcem
  • 3,900
  • 4
  • 28
  • 66
0
votes
1 answer

Example or docs for LiveScript scope

Am just starting out with Livescript and want to know how the scope works. Are the any good example/docs that show all scope symbols and usage. Symbols like: @ -> vs ~> self := Edit The problem I face: This ethercalc code: line 103. I want to…
eddyparkinson
  • 3,680
  • 4
  • 26
  • 52
0
votes
1 answer

Search up definitions

This is my code for livescript: if (res = json.msg.match /^iSearchup\s(.*)$/i)? then getReq("[url='http://urbanscraper.herokuapp.com/define/'][http://urbanscraper.herokuapp.com/define/[/url]" +…
17buih
  • 1
  • 1
0
votes
1 answer

LiveScript for loop not behaving or I have the wrong syntax

Under normal circumstances (vanilla JS) I might do something like this - var mystring = "foo"; for(i = 0; i < mystring.length; i++) { console.log(i); } Which will return [0,1,2]` I cannot find the syntax to produce that behavior in LiveScript.…
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
0
votes
1 answer

In Livescript, what does [Object] mean?

I have a LiveScript program which when asked to print out a data structure, instead prints "[Object]". LiveScript is normally very good at printing out objects or lists of differently typed objects, so what does this message indicate? Why can it not…
Mark Green
  • 1,310
  • 12
  • 19
0
votes
1 answer

How to write async.series nested for loop

I have this code that works: require! [async] action = for let m from 1 to 12 (p) -> p null, m err, data <- async.series action console.log data but I having difficulties to have the code works on a nested loop: action = for let…
muyueh
  • 1,018
  • 13
  • 16
0
votes
1 answer

WebStorm file watchers on Windows

I want a file watcher for LiveScript, so I installed it with npm install LiveScript -g and this works like expected. I can now type livescript into cmd and compile files. But when I try to use livescript as Program in a watcher, WebStorm tells me…
K..
  • 4,044
  • 6
  • 40
  • 85
0
votes
1 answer

How to list down all methods with livescript?

In python there is dir(module): In [6]: dir(datetime) Out[6]: ['MAXYEAR', 'MINYEAR', '__doc__', '__file__', '__name__', '__package__', 'date', 'datetime', 'datetime_CAPI', 'time', 'timedelta', 'tzinfo'] Elixir you can type the…
Muhammad Lukman Low
  • 8,177
  • 11
  • 44
  • 54
0
votes
1 answer

Is it possible to define hoisted curried functions in Livescript?

How do you define a curried function with the function keyword in Livescript? More succinctly, how can I get this function curry (arg1, arg2) do-something arg1, arg2 To act like this curry = (arg1, arg2) --> do-something arg1, arg2
Dan Prince
  • 29,491
  • 13
  • 89
  • 120