1

I downloaded prelude.js and added it in my application. I linked the js file in my html file in the following way:

<script type="text/javascript" src="prelude-browser-min.js"></script>

I didn't link any dependent file in my html file. I opened the browser console and ran the following code, which is not working:

tail [1 to 5]

It looks like I'm not able to see the prelude function.

So do I need to add any other file in my html headers ? What am I doing wrong ?

Ehvince
  • 17,274
  • 7
  • 58
  • 79
user2873816
  • 179
  • 1
  • 5
  • 16
  • If I am not mistaken this is livescript that won't run by default in the browser. – bagonyi Dec 04 '13 at 17:56
  • It works with vanilla js too. – nullpotent Dec 04 '13 at 17:57
  • Try referencing prelude with an underscore: `_.tail()` – bagonyi Dec 04 '13 at 18:00
  • @bagonyi I tried what they suggested in Installation from this `http://preludels.com/#head`link.I added underscore.js file in my application.after that How am I need to go ahead.can you suggest me clearly. – user2873816 Dec 04 '13 at 18:25
  • @iccthedral first I thought don't want to use `venilla.ja`.I read some tutorials as per I know it's very powerful and lightweight. So I downloaded and added in my application. So can you suggest me how to use `prelude.js` with `venilla.ja`. – user2873816 Dec 04 '13 at 19:06

1 Answers1

3

That's livescript syntax, but if you want to use vanilla js; here's a jsfiddle setup.

var prelude = require('prelude-ls')
tail = prelude.tail([1,2,3,4,5])
console.log(tail);
nullpotent
  • 9,162
  • 1
  • 31
  • 42
  • I tried what they suggested in Installation from this http://preludels.com/#headlink.I already added `underscore.js` in my application. If you have an idea how to use `prelude.js` using `underscore.js` suggest me.Why I am not ready to use `venilla.js` because I don't want to use one more new library with out knowing. – user2873816 Dec 04 '13 at 18:35
  • 1
    You're totally confused. Check your vocabulary. But before that, visit the link I provided; there's a setup for you. You don't need `underscore.js` nor `venilla.js`. You need `require.js` and that's all. – nullpotent Dec 04 '13 at 18:55
  • thanks it's working great.I can't able to run some functions which have more arguments.I tried `prelude.List.partition((> 60), [49 58 76 43 88 77 90])` it's not working.tell me once.Sure I will change my vocabulary. – user2873816 Dec 04 '13 at 19:25
  • @user2873816 You're still using livescript syntax, but you're working with javascript, that's why you're seeing errors. Check the link again, I updated it. – nullpotent Dec 04 '13 at 19:36
  • Hey where do I download this vanilla.js library? ;) – Anthony Jun 20 '15 at 18:53
  • 1
    @mrmayfield Nowhere, there's none. Vanilla JS is a term that describes a "pure" javascript language as per EcmaScript specification, without syntactic sugars, libraries, and whatnot. To put it simply, vanilla js is just common js, that one codes with these days. – nullpotent Jul 02 '15 at 12:45
  • Just trying to inject some humour, hence the winky face. Hopefully no one ever does consider making a vanillaJS library because that would certainly cause some headaches haha. – Anthony Jul 02 '15 at 17:40
  • Haha, it would indeed. *One should always pay attention to winkies and smilies* :) – nullpotent Jul 02 '15 at 18:05