W3C home > Mailing lists > Public > public-csv-wg@w3.org > September 2014

Re 2: Reflection on the special telco of CSVW

From: Ivan Herman <ivan@w3.org>
Date: Tue, 16 Sep 2014 17:39:26 +0200
Cc: Dan Brickley <danbri@google.com>, W3C CSV on the Web Working Group <public-csv-wg@w3.org>, Axel Polleres <axel.polleres@wu.ac.at>
Message-Id: <C7628448-9A5F-4ADA-96A8-8F8BA16ABBCE@w3.org>
To: Andy Seaborne <andy@apache.org>
I have extended my experiment to include 


filters, where these filters can also take the form of f("arg1","arg2",...) with string arguments. This means that, if needed, the replace, concat, etc, string manipulation filters, as well as the time related filters (where arg could be used to encode a time format) can all be added. Note that the same syntax can also be used for 


where 'datatype' is a filter that returns the data type string, if any, defined in the metadata for that cell.

I begin to like this:-) And the fact that I could implement all this without years of experience in Javascript is a good sign.


On 14 Sep 2014, at 11:44 , Andy Seaborne <andy@apache.org> wrote:

> On 14/09/14 08:39, Ivan Herman wrote:
>> The complexity of alt-1 comes from, e.g., flow control. But not only.
>> If we allow for a, say, replace, we would have to have a syntax (and
>> processing) of extra parameters. One extra step may be something
>> like
>> {{name.filter1("regexp").filter2}}
>> which may still work (and, of course, it may be used for other
>> purposes, too, like date formats), but would we go again one step
>> further and say something like
>> {{name.filter1({{name2}}).filter2}}
>> ie, having some sort of a recursive macro? We are heading, in my
>> view, back to Alternative 1, ie, a complex language to specify,
>> implement, test, etc. That is what I called 'floodgates'...
> That's not recursion :-) just plain function nesting.
> We may not even want that but it is not a technical problem.
> Spreadsheets get their complexity because cells themselves can contain formulae and so when one cell can name another cell, it means there can be dependency loops.
> In a CSV file, the cells are only atomic values and everything bottoms out without dependency loops.
> 	Andy
> if you want an outline proof  :-)
> An evaluation algorithm, not necessarily the best, is:
> 1/ Find inner most {{}}
>   if none, we're done.
> 2/ Evaluate that expression.
> This is not another {{}} because that would be a "more inner".
> 3/ Replace {{}} by the result.
> 4/ Goto 1
> That is not going to go on forever as you step out one level of {{}} each time.  No pointers, no way to write anything other than a tree.
> And you're not going to encounter an another formula while doing the evaluate because the inner most {{}} does not contains another {{}}.
> if name2 is "foo"
> and name is "foobar"
> {{name.stringafter({{name2}}).uppercase}}
> -->
> {{name.stringafter("foo").uppercase}}
> -->
> {{"foobar".stringafter("foo").uppercase}}
> -->
> {{"bar".uppercase}}
> -->
> "BAR"
> c.f. "let" vs "letrec"
> =>
> ftp://ftp.cs.utexas.edu/pub/garbage/cs345/schintro-v14/schintro_66.html

Ivan Herman, W3C 
Digital Publishing Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
GPG: 0x343F1A3D
WebID: http://www.ivan-herman.net/foaf#me

Received on Tuesday, 16 September 2014 15:40:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:27:42 UTC