Ceylon Vert.x docs contain errors #2
Comments
hi, the examples are generated by a generator from java examples. The other generators (for JavaScript, Groovy and Ruby) are better than the Ceylon one as of today and the Ceylon generator should be improved to fix the problem you are listing.
|
btw the code translator can be found here if you are curious https://github.com/vert-x3/vertx-lang-ceylon/tree/master/vertx-lang-ceylon-doc/src/main/java/io/vertx/codetrans/lang/ceylon |
Interesting approach to doc creation! Makes sense that these should be generated automatically from a set of canonical examples in Java. I suggest working through the examples from top to bottom at some point... there are lots of gotchas! |
I pushed improvements for the addressable points:
|
Thanks for fixing these issues. (I saw the trailing '_' notation in some Ceylon example code, so I assume it's idiomatic, but I'm new to Ceylon...) Did try to reproduce the problem in my 4th point? I don't think it's a problem with the example code, I think it's a problem with the bindings themselves. (Sorry to list multiple bugs in one problem report...) |
I haven't yet looked at it, as I focused on the cosmetic doc points. I will have a look now. I'll open an issue if needed. |
and will ref it from this issue |
I just tried the example and indeed I only see "timer1" (when corrected). But if I add print() statements, then it works fine, see:
|
ok so the reason is that it does not work is that the generated code is wrong:
means actually : returns (=>) an Iterable ({ ... }) that is lazy evaluated. so the correct code is to use:
or
so this is an issue related to the doc generator. |
Makes sense.
BTW I suggest renaming the imports with underscore, not the local variables
-- this will make for cleaner code.
|
that's what I did |
? The example you pasted above has
instead of
but maybe the code above does things differently than the code generator. |
ah, this is real code I wrote in Ceylon IDE, that's why it's not aliased like in the doc. When I'm done with improvements I'll repost here the result :-) |
now the generated code is:
|
the website online doc has been updated with the refreshed docs : http://vertx.io/docs/vertx-web/ceylon/ |
Great, thanks for your work on this.
|
The docs for using Vert.x in Ceylon docs have numerous omissions and errors.
value vertx = vertx.vertx();
as suggested in the vertex.core docs, you needimport io.vertx.ceylon.core { vertx_=vertx }
thenvalue vertx = vertx_.vertx();
.=>
and{}
together in lambda expressions, e.g.(RoutingContext routingContext) => { }
should actually be(RoutingContext routingContext) { }
..next()
never ends up calling the code for route2. I haven't figured out why yet.Has anybody actually tried to work through these examples from beginning to end? It seems like there's something wrong with every example I have tried so far.
The text was updated successfully, but these errors were encountered: