| ||||||||
| Scheme lists (as the list of Python) can contain any kind of S-expression/object, it suffices to have the sub-expressions correctly written and the brackets balanced: ("hi" ((((1 2 3 (4))))) 42/7) What kind of data structures we may have if we allow unbalanced brackets too, like for example: ((1 2) It may be like a strange way to represent partially undefined trees. For simplicity we can hypothesise that to obtain all the defined trees from that undefined representation we can only add closed brackets, then that may represent any of: ((1) 2) ((1 2)) That is: +--+ | 2 + 1Or: +--+ | | + + 1 2A way to represent multiple or partially undefined structures may be useful for various purposes (like to express a situation of partial approximation, or to represent a double meaning of natural words, or something like the Koans, where few ideograms can be read in few different ways with different meanings, etc), but this time I haven't found a way to use them for something practical still. --------------------------- Le liste Scheme (come le list Python), possono contenere ogni tipo di oggetto, e' sufficiente che gli atomi siano scritti correttamente e che le parentesi siano bilanciate: ("hi" ((((1 2 3 (4))))) 42/7) Che tipo di struttura dati si avrebbe se si permettessero anche scritture con parentesi non bilanciate, ad esempio: ((1 2) Potrebbe essere un modo strano per rappresentare alberi parzialmente indefiniti. Se per semplicita' ipotizziamo che per ottenere tutti gli alberi definiti a partire da una tale rappresentazione indefinita si possano aggiungere solo parentesi chiuse, allora tale espressione potrebbe rappresentare una qualunque di: ((1) 2) ((1 2)) Cioe': +--+ | 2 + 1Oppure: +--+ | | + + 1 2Avere modi per rappresentare strutture "multiple" o parzialmente indefinite e' potenzialmente utile per vari scopi (potrebbe essere un modo per esprimere una situazione di parziale approssimazione, o per rappresentare qualcosa di simile ai giochi di parole cioe' a dei doppi sensi matematici, o ai Koan dove degli ideogrammi hanno significati multipli, ecc), ma in questo caso non sono ancora riuscito a trovare una possibile applicazione pratica. | ||||||||
| comments: Leave a comment |