World: r3wp
[All] except covered in other channels
older newer | first last |
Ashley 12-Mar-2006 [2127] | An ISAM-like solution is pretty handy for folks who want something more than plain-text storage but something less than a full-blown RDBMS. |
Sunanda 13-Mar-2006 [2128] | I'd like a basic cross-platform data manager of the sort Ashley suggests. That can then be used to build SQL type databases for those who want them. Or list type databases (for people like me who use that sort of approach a lot) Or whatever. No need to prematurely bind to the relational model/ |
Robert 13-Mar-2006 [2129] | What's your "list type databases"? |
Henrik 13-Mar-2006 [2130] | I'm all for "everything in" if it doesn't blow up the executable size. "Everything in" is one of the main reasons I use REBOL. Imagine if we had to include VID, network, etc. from external libraries... |
Sunanda 13-Mar-2006 [2131] | An SQL type database is one where the basic unit of storage is an atomic data item, though packaged into rows / tuples. Getting rid of 1NF data (recurring groups) is the first thing you are taught to do. In a list type database the basic unit of storage is a list (think REBOL block). That's far from being 1NF, especially as a list can contain other lists. |
Thør 1-Apr-2006 [2132x3] | . |
. | |
. | |
Terry 1-Apr-2006 [2135] | Ok.. that's a bit excessive |
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. | |
older newer | first last |