Re 2: Reflection on the special telco of CSVW

I have extended my experiment to include 

{{name.f1.f2.f3}}

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 

{{name.datatype}}

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.

Ivan


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