Commit Graph
230 Commits
Author SHA1 Message Date
Bob Nystrom 919605b7ba Couple of tiny tweaks. 2016-02-24 06:52:12 -08:00
Bob Nystrom 2c4e497c54 Fix a couple of doc bugs. 2016-02-22 07:48:53 -08:00
Bob Nystrom 60162575ee More file system checking functions:
- Stat#isFile
- Stat#isDirectory
- Directory.exists()
- File.exists()
2016-02-21 12:23:33 -08:00
Bob Nystrom 8e90e3577b More file IO!
Can now create, delete, and write to files.
2016-02-20 09:23:42 -08:00
Mathieu Gagnon ff69b12c2c Fix sample in doc/site/error-handling
Add missing constructor.
2016-02-11 18:06:51 -05:00
Mathieu Gagnon a2e03279e2 Fix abs code sample in doc/site/modules/core/num
-123.abs returns -123 because the dot has higher precedence so it's
 really -(123.abs).
2016-02-11 17:58:09 -05:00
Bob Nystrom 68ab4e88c0 Merge branch 'master' of https://github.com/munificent/wren 2016-02-09 07:24:55 -08:00
Bob Nystrom 8b36e2f00b Add sample(_) and sample(_,_) to Random. 2016-02-09 07:24:45 -08:00
Mathieu Gagnon 82307232cc Update wrenInterpret doc/site/embedding-api 2016-02-08 08:34:56 -05:00
Bob Nystrom d4a4b26203 Add Random.shuffle(). 2016-02-07 10:38:39 -08:00
Bob Nystrom 79558d95e5 Move File.stat() -> Stat.path().
Thanks, Michel!
2016-02-07 09:56:16 -08:00
Bob Nystrom ffb5ada9fb Move the community docs to the wiki. 2016-01-24 15:39:35 -08:00
Bob Nystrom 71e2458a6c Add API for accessing command-line arguments.
- Add process module with Process class.
- Add "arguments" and "allArguments" methods.
- Docs for same.
- Support passing additional arguments to command line.
- Add "--help" support to command line.
2016-01-22 07:57:26 -08:00
Bob Nystrom 056ae61493 Tweak some docs. 2016-01-21 21:38:27 -08:00
Bob Nystrom 94208647ab Test File.stat() on a directory. 2016-01-01 10:05:31 -08:00
Bob Nystrom 5cd8a06fa0 File.stat(). 2016-01-01 09:58:44 -08:00
Bob Nystrom b054526df8 Add an optional offset to File.readBytes(). 2015-12-30 08:13:19 -08:00
Bob Nystrom 6e2ec92e0d Fix parameter format in docs. 2015-12-29 22:35:14 -08:00
Bob Nystrom 452cc88082 Fix a few typos in the docs. 2015-12-29 22:29:13 -08:00
Bob Nystrom 8854dfb07e Docs for the io module! 2015-12-29 21:56:44 -08:00
Bob Nystrom 5454152dff Merge pull request #313 from acook/patch-1
Fixing a couple of typos in the classes docs.
2015-11-25 08:59:16 -08:00
Bob Nystrom fb72e0fff7 Document method scope. 2015-11-21 14:00:21 -08:00
Bob Nystrom 03163a760f Document interpolation. 2015-11-21 09:20:50 -08:00
Anthony M. Cook da3eac9a48 Fixing a couple of typos in the classes docs. 2015-11-20 12:56:27 -06:00
Bob Nystrom de7b062a03 Tweak module docs a bit. 2015-11-09 07:42:48 -08:00
Bob Nystrom 902289d7dd Document the "random" module. 2015-11-09 07:37:06 -08:00
Bob Nystrom 82706b74fc Reorganize site to make room for documenting the other built-in modules. 2015-11-08 13:31:22 -08:00
Bob Nystrom 8c0dae1320 Move precedence table to syntax page. 2015-11-08 10:59:23 -08:00
Bob Nystrom 0bf5dc42ef Remove outdated docs. 2015-11-07 13:00:49 -08:00
Bob Nystrom 7ae9888c4f It turns out "is" is just a normal overridable operator. Who knew? 2015-11-07 13:00:24 -08:00
Bob Nystrom 931d9ca4d3 Reorganize the language guide.
- Rename "Expressions" -> "Method Calls".
- Organize "Types" and "Language" into a single linear narrative.
- Mobile-specific navigation to handle the longer guide.
- Rename "Fibers" -> "Concurrency".
- Get rid of duplicate stuff about signatures in "Classes".
- Add next/prev links to each page in the guide.
- Move "Contributing" and "Community" up to the top level.
- Move the precendence table to a separate "Grammar" page.
- Lots of other little stuff.
2015-11-07 11:09:04 -08:00
Bob Nystrom 720c03cf49 Add System.gc(). 2015-10-24 10:56:27 -07:00
Bob Nystrom 545a4cbf7e Style example output and errors in the docs. 2015-10-18 15:56:52 -07:00
Bob Nystrom e968b4bf98 Fix two typos in the docs. 2015-10-03 21:45:59 -07:00
Bob Nystrom e41d9eac7c Tweak the embedding docs a bit. 2015-10-02 21:25:55 -07:00
Bob Nystrom bacbd85543 Add .isInfinity and .isInteger to Num. 2015-09-30 08:41:43 -07:00
Bob Nystrom b05a74da19 Revamp how runtime errors and fiber switching is handled.
- Add Fiber.transferError(_).
- Primitives place runtime errors directly in the fiber instead of on
  the stack.
- Primitives that change fibers set it directly in the VM.
- Allow a fiber's error to be any object (except null).
2015-09-29 22:57:03 -07:00
Bob Nystrom a944ead5b4 Give the docs some love. 2015-09-22 21:19:38 -07:00
Bob Nystrom 505b48fdac Add a real Pygments lexer for Wren (finally!). 2015-09-22 07:59:54 -07:00
Bob Nystrom 251752fcfb Make join() require parentheses without a separator. 2015-09-16 07:15:48 -07:00
Bob Nystrom 58e4d26648 "IO" -> "System".
Get rid of the separate opt-in IO class and replace it with a core
System class.

- Remove wren_io.c, wren_io.h, and io.wren.
- Remove the flags that disable it.
- Remove the overloads for print() with different arity. (It was an
  experiment, but I don't think it's that useful.)
- Remove IO.read(). That will reappear using libuv in the CLI at some
  point.
- Remove IO.time. Doesn't seem to have been used.
- Update all of the tests, docs, etc.

I'm sorry for all the breakage this causes, but I think "System" is a
better name for this class (it makes it natural to add things like
"System.gc()") and frees up "IO" for referring to the CLI's IO module.
2015-09-15 07:46:09 -07:00
Bob Nystrom 92c2b2d5e0 Copy edit the string docs. 2015-09-12 09:42:31 -07:00
Bob Nystrom fe143644b3 Rationalize string lengths.
The .count getter on string returns the number of code points. That's
O(n), but it's consistent with the rest of the main string API.

If you want the number of bytes, it's "string".bytes.count.

Updated the docs.

Fixes 68. Woo!
2015-09-11 21:33:26 -07:00
Bob Nystrom c0b5ec9f15 Move codePointAt() to separate CodePointSequence class. 2015-09-11 07:56:01 -07:00
Bob Nystrom 2e83f056c1 No more default constructors.
Fixes #296.
2015-09-01 08:16:04 -07:00
Bob Nystrom 6559edbc56 Update docs to mention libuv. 2015-08-30 22:38:40 -07:00
Bob Nystrom 556af50f83 Revise low level fiber semantics to play nicer with schedulers.
Now that I'm starting to write a real async scheduler on top of Wren's
basic fiber API, I have a better feel for what it needs. It turns out
run() is not it.

- Remove run() methods.
- Add transfer() which leaves the caller of the invoked fiber alone.
- Add suspend() to return control to the host application.
- Add Timer.schedule() to start a new independently scheduled fiber.
- Change Timer.sleep() so that it only transfers control to explicitly
  scheduled fibers, not any one.
2015-08-30 22:15:37 -07:00
Bob Nystrom 610952f727 Update line count in docs. 2015-08-20 22:34:33 -07:00
Bob Nystrom 69b0d34065 Start working on docs for the embedding API. 2015-08-20 22:02:13 -07:00
Bob Nystrom 71ab3ca887 Use "construct" instead of "this" to define constructors. 2015-07-21 07:24:53 -07:00