World: r3wp
[Topaz] The Topaz Language
older | first |
Gabriele 29-Nov-2011 [265] | missing object: look at the source of try-topaz.html. what you need is probably there. |
Gabriele 1-Dec-2011 [266] | I don't have string parsing in Topaz yet, but I wanted to illustrate how what Endo is asking in the Parse group would be much easier: Topaz Interpreter - (C) 2011 Gabriele Santilli - MIT License >> b: ["bla" 1 2 "bla"] == ["bla" 1 2 "bla"] >> parse b [collect any [keep number! | skip]] == [1 2] |
Geomol 1-Dec-2011 [267] | Looks simple. Cool! |
Pekr 2-Dec-2011 [268] | Cool, I want collect/keep in R3 too :-) |
PeterWood 2-Dec-2011 [269] | >> parse b [collect any [keep number! | skip]] == [1 2] Very interesting. What would be returned if the parse rule was more complicated and "failed" (ie would have returned false in REBOL). |
Gabriele 2-Dec-2011 [270x2] | If it fails, it returns none. |
PARSE works in a similar way to DO, in that it returns the last "result". I will document this in detail before a 1.0 release. There is a slide in my september presentation about PARSE vs. INTERPRET which explains why I went this route. | |
PeterWood 2-Dec-2011 [272] | Thanks, Gabriele |
BrianH 2-Dec-2011 [273] | Does it return the subject series at the position of the last result, or does it return the last recognized pattern as a value? |
Gabriele 3-Dec-2011 [274] | Brian, each "rule" has two effect: it advances the series, and returns a result. Most rules return the matched value, but not all. Examples: >> parse [1] [number!] == 1 >> parse [1 2 3] [number! number! number!] == 3 >> parse [1 2 3] [some number!] == 3 >> parse [1 2 3] [object [a: number! b: number! c: number!]] == object none [ == a: 1 == b: 2 == c: 3 == ] >> parse [1 2 3] [object [a: number! b: object [c: number! d: number!]]] == object none [ == a: 1 == b: object none [ == c: 2 == d: 3 == ] == ] |
BrianH 3-Dec-2011 [275] | Seems a bit like a cross between a destructuring matcher and regex. Useful. |
GiuseppeC 15-Dec-2011 [276] | Hi, I am interested into building an maintaining documentation for those programming languages based on REBOL. It would be nice to have a DOCBASE for them. What I search is: - Someone ABLE to SETUP the Linux and the Wiki Software - Someone which would share with me the cost of hosting. Do you like the idea ? Write me at [giuseppe-:-chillemi-:-eu] |
Gabriele 16-Dec-2011 [277] | Note, the Topaz specific wiki is on github: https://github.com/giesse/Project-SnowBall/wiki |
AdrianS 7-Feb-2012 [278x2] | Gabriele, you might want to update the Getting Started page on github in relation to using Topaz with Windows. The situation is much improved now that there is an official Node installer (also includes npm). |
so you don't need to mess around with Cygwin anymore | |
Gabriele 8-Feb-2012 [280x2] | Thanks, I don't really use Windows so it's hard for me to keep up to date on that front. Peter already said he's going to update the wiki; if anyone else wants to help, I believe github allows a fork approach to the wiki as well, otherwise I can add you to the main wiki to edit it directly. |
Also, you only really need to install node etc. if you want to work *on* Topaz, otherwise you can use any web browser to just *use* Topaz, like in the try-topaz.html example. | |
Henrik 8-Feb-2012 [282x2] | I wonder if it makes sense to allow REBOL to call try-topaz.html, although it would be calling JS code? Then you could mix Topaz with REBOL for tests, etc. |
res: topaz [1 + 2] | |
Gabriele 8-Feb-2012 [284] | a topaz function for REBOL, you mean? |
Henrik 8-Feb-2012 [285] | yes, something like that |
Gabriele 8-Feb-2012 [286x2] | once I have the compiler, it would certainly be possible to target REBOL instead of JS. not sure if that is useful though. :-) |
but, i guess you can use CALL to run node.js, or you can get node.js to listen to a tcp port and connect to it from REBOL, etc. | |
Henrik 8-Feb-2012 [288x2] | I was only thinking about whether it could be used to test topaz vs. rebol via one piece of code. |
ok | |
Maxim 8-Feb-2012 [290] | henrik, do you mean something like? : topaz: func [ block ][ load read/custom http://server/try-topaz.htmlreduce ['POST mold block] ] (where the post data above is replaced by whatever is required to properly fill in the form) |
Gabriele 8-Feb-2012 [291] | Maxim, certainly not, as there is no server side whatsoever to try-topaz.html |
Maxim 8-Feb-2012 [292] | ok, I thought the discussion about using node.js was for this purpose... to have server and client side using the same language... sorry for the confusion. |
Gabriele 8-Feb-2012 [293] | Topaz runs in any JS interpreter; I use node.js because it's convenient. try-topaz.html uses the JS interpreter in your browser to run Topaz. |
Henrik 8-Feb-2012 [294] | then it may be too much trouble. I was simply curious. |
GrahamC 8-Feb-2012 [295x3] | No arithmetic operators in topaz yet? |
>> 37 * 11 *** Script error: Word has no value: * *** Stack: * 11 | |
Not implemented | |
PeterWood 12-Feb-2012 [298] | I've updated the getting started wiki page at GitHub. Please let me know if there are any errors in it. |
GrahamC 20-Feb-2012 [299] | Last comitt was 3 months ago? |
Gabriele 21-Feb-2012 [300] | I'm busy. |
Gabriele 22-Feb-2012 [301] | Added a couple commits to make Graham happy. :P |
GrahamC 22-Feb-2012 [302] | I need to check the Topaz G+ hangout :) |
Gabriele 23-Feb-2012 [303:last] | We need to do that again soon... I'm leaving for LA in about a week, then we have BIL2012 there, then I'll see if I can set up a hangout. |
older | first |