World: r3wp
[All] except covered in other channels
older newer | first last |
Jean-François 2-May-2006 [2136] | I'm looking for a good FTP Client for XP. Any suggestions? |
Henrik 2-May-2006 [2137] | well, Total Commander is ok |
Anton 2-May-2006 [2138] | SmartFTP |
Rebolek 2-May-2006 [2139] | TotalCommander is not bad, but misses secure FTP connection. FileZilla or UltraFXP were recommended to me. |
james_nak 2-May-2006 [2140] | What about Reichart's FTP client? |
Geomol 2-May-2006 [2141] | I've found the PuTTY suite of tools good: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Maybe PSFTP can do the job? |
Sunanda 2-May-2006 [2142] | SmartFTP is the one I use. |
Gabriele 2-May-2006 [2143x6] | Brian, what do you think about this? |
match: func [block rule /local recurse result] [ result: false parse block recurse: [ some [ rule (result: true) | into recurse | skip ] ] result ] | |
example: | |
qml-test: [ qml [toc [toc-title [font opts [face "georgia"] "Table of contents"]] [h1 [font opts [face "georgia"] "one"]] [para [font opts [face "georgia"] "bla " [font opts [face "times"] "bla"]]] [h1 [font opts [face "georgia"] [font opts [face "times"] "two"]]] [para [font opts [face "georgia"] [font opts [face "times"] "bla bla"]]] [olist [oitem [font opts [face "georgia"] [font opts [face "times"] "one"] " cont"]] [oitem [font opts [face "georgia"] "two"] " cont"] [oitem "three"] ] [h1 "three"] [para "bla bla"] [h3 "four"] [para "bla bla"] [h1 "five"] [h2 "six"] [h2 "seven"] ] ] | |
>> match qml-test [x: ['h1 | 'h2 | 'h3] to end (probe x)] [h1 [font opts [face "georgia"] "one"]] [h1 [font opts [face "georgia"] [font opts [face "times"] "two"]]] [h1 "three"] [h3 "four"] [h1 "five"] [h2 "six"] [h2 "seven"] == true | |
>> match qml-test [x: 'font to end (probe x)] [font opts [face "georgia"] "Table of contents"] [font opts [face "georgia"] "one"] [font opts [face "georgia"] "bla " [font opts [face "times"] "bla"]] [font opts [face "georgia"] [font opts [face "times"] "two"]] [font opts [face "georgia"] [font opts [face "times"] "bla bla"]] [font opts [face "georgia"] [font opts [face "times"] "one"] " cont"] [font opts [face "georgia"] "two"] == true | |
BrianH 2-May-2006 [2149] | Interesting. It would work with my XML data structure, assuming I used a block for the attributes rather than a hash (something I considered anyway). |
Gabriele 2-May-2006 [2150x5] | you can also build rewrite on top of it: |
rewrite: func [block rules /local rules* rule flag mk1 mk2 prod] [ if empty? rules [return block] rules*: make block! 16 foreach [pattern production] rules [ insert insert/only insert/only tail rules* pattern make paren! compose/only [ prod: compose/deep (production) ] '| ] remove back tail rules* until [ ;probe block ask "" not match block [mk1: rules* mk2: (mk2: change/part mk1 prod mk2) :mk2] ] block ] | |
or, you can collect the matched values: | |
collect: func [output block rule /local x] [ match block [copy x rule (append/only output x)] output ] | |
of course parse may not be the best for every kind of structure matching. but it can be a good start. | |
BrianH 2-May-2006 [2155] | I would like to review how this kind of structure matching is done in other functional languages with the feature. I like this version and would use it if it were there, but they may have solved some problems unforseen by us already. |
Gabriele 2-May-2006 [2156] | well the hard thing to do with parse is longest match. |
BrianH 2-May-2006 [2157] | My biggest problem with your rebcode rewrite rules was generating temporaries. I have the same problem with rewriting parse rules - actually more of one because of recursion problems. |
Gabriele 2-May-2006 [2158x2] | if you come up with a dialect idea, let me know; maybe it's possible to write a compiler to parse, or we can just implement it directly. |
rewrite is very tricky done this way | |
BrianH 2-May-2006 [2160] | Perhaps a supply of temporaries could be provided to the rewriter for it to use, and then it would complain if it didn't have enough. |
Gabriele 2-May-2006 [2161x2] | but probably rewriting is tricky in itself. |
you mean, temp local words? | |
BrianH 2-May-2006 [2163] | I mean words defined in the calling context that can be used as temporaries by the resulting code without having dificulties. |
Gabriele 2-May-2006 [2164] | do you have an example? (i don't know if we can find a general solution, but i'm sure each problem can be solved quite easily) |
BrianH 2-May-2006 [2165] | Parse has this problem in particular for its temporary variables - they aren't very recursion safe. You can do some hacks to make up for missing parse keywords using code blocks, but usually those need some temporaries. |
Gabriele 2-May-2006 [2166] | i usually just tend to avoid recursion when it is not really needed, and i try to stay alert when i need it ;) |
BrianH 2-May-2006 [2167] | When parsing recursive structures, you often need recursion-safe local variables. I run into this when writing compilers pretty often. |
Gabriele 2-May-2006 [2168x3] | i have been thinking about function! values inside parse rules; parse could you the function code block as a rule, but "enter" the function when entering the rule; so you can take advantage of the function's context. |
you could even define parametric rules | |
i was also wondering if it made sense to allow return values; but it doesn't match the current parse at all so i'm not sure. | |
BrianH 2-May-2006 [2171x2] | Parse uses a lot of temporaries for doing common tricks with code blocks that should really be built into parse as keywords, like REMOVE, REPLACE, UNLESS, USE, etc. |
I've wanted parametric rules for years. | |
Gabriele 2-May-2006 [2173x2] | there are many subtle issues with a proposal like this though. |
i wonder if it's possible to experiment with it with mezz code. | |
BrianH 2-May-2006 [2175x2] | make rule! [[locals] [rules]] |
Using a variant on Carl's new make function! syntax. | |
Gabriele 2-May-2006 [2177] | would rule! really be different than function! ? |
BrianH 2-May-2006 [2178] | A new function type where the code block would be executed by the parse engine rather than the DO engine. |
Gabriele 2-May-2006 [2179x3] | but you can't call it outside of parse anyway |
and you can't use functions inside parse either | |
so it's just rule!: function! | |
BrianH 2-May-2006 [2182x2] | You could keep the spec block mostly the same as function!, just like rebcode does. Calling it would call parse on its first argument. This would be sort-of like a parse rule compiler. |
Calling it directly I mean. | |
Gabriele 2-May-2006 [2184x2] | but that wouldn't be very useful inside parse then |
well... i need to get some sleep. this is a very interesting topic though. i hope we can improve parse on r3 too (the problem is deciding where to stop). | |
older newer | first last |