Re: Data structure design again
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 12/11/2013 05:52 AM, Richard A. O'Keefe wrote: > Someone is bound to freak out at the idea of representing +1 > [:x | x + 1] as block(lambda([x],[],call(+,[var(x),integer(1)]))) > but I've tried it without the outer discriminator and it makes > writing the code so error prone it's not worth it. In any case, Languages are in my opinion always a compromise between the human and the machine. Humans like something concise and intuitive. Machines like something precise and explicit. Saying "1" (without the quotes) is for a human enough to specify we are talking about an integer. Having to write "integer(1)" is a lot of work as well as hard to read as you have to process all this text and brackets. It also makes it hard to give a good layout to larger structures. Well, we already knew we disagree on these things when discussing mark down ... All I want to achieve is to reduce the number of cases where we _force_ people to use this verbose syntax to define their data or DSL representation. Anyone is still free to do so and often it is a good idea. > the *proportional* overhead is slight. For atomic data about a factor 3. The leafs often atomic and that is where most of the space goes. Whether or not that is `slight' depends completely on the application. Often it is. Sometimes it is not. Cheers --- Jan