equal
deleted
inserted
replaced
1 <stránka |
1 <stránka |
2 xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana" |
2 xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana" |
3 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"> |
3 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"> |
4 |
4 |
5 <nadpis>Aggregating data with Guile</nadpis> |
5 <nadpis>Aggregating data with Scheme</nadpis> |
6 <perex>counting records and computing sum</perex> |
6 <perex>counting records and computing sum</perex> |
7 <m:pořadí-příkladu>01700</m:pořadí-příkladu> |
7 <m:pořadí-příkladu>01700</m:pořadí-příkladu> |
8 |
8 |
9 <text xmlns="http://www.w3.org/1999/xhtml"> |
9 <text xmlns="http://www.w3.org/1999/xhtml"> |
10 |
10 |
11 <p> |
11 <p> |
12 In <code>relpipe-tr-guile</code> we can generate new records – not only modify records from the input. |
12 In <code>relpipe-tr-scheme</code> we can generate new records – not only modify records from the input. |
13 There is <code>--has-more-records</code> option which – if evaluated as true – says: „read one more record from the Guile context and call me again“. |
13 There is <code>--has-more-records</code> option which – if evaluated as true – says: „read one more record from the Scheme context and call me again“. |
14 We can also suppress all original records by <code>--where '#f'</code>. |
14 We can also suppress all original records by <code>--where '#f'</code>. |
15 And we can also change the structure of the relation (see previous examples). |
15 And we can also change the structure of the relation (see previous examples). |
16 Thus we can iterate through a relation but completely replace its structure and content. |
16 Thus we can iterate through a relation but completely replace its structure and content. |
17 </p> |
17 </p> |
18 |
18 |
47 SQL is much more declarative and for many cases a better tool. |
47 SQL is much more declarative and for many cases a better tool. |
48 In SQL we describe „how the result should look like“ instead of „how the result should be produced step by step“. |
48 In SQL we describe „how the result should look like“ instead of „how the result should be produced step by step“. |
49 </p> |
49 </p> |
50 |
50 |
51 <p> |
51 <p> |
52 One day, there might also be a translator that parses SQL code and generates Guile code, |
52 One day, there might also be a translator that parses SQL code and generates Scheme code, |
53 so we could have advantages of both worlds |
53 so we could have advantages of both worlds |
54 a) concise and declarative syntax of SQL and |
54 a) concise and declarative syntax of SQL and |
55 b) streaming – which means no need for putting all the data in the RAM or on the disk. |
55 b) streaming – which means no need for putting all the data in the RAM or on the disk. |
56 </p> |
56 </p> |
57 |
57 |