"Shaping" <shap...@charter.net> writes: <snip> > Doing the immediate eval leaves > > T{ parser f ~action-parser~ f 4820 } > > How am I expected to use this notation?. I read: "a parser instance", > constant f (false), "something to do with a parse and its action", another > false constant, number 4820. I can't do any real thinking with that. Why > don't we have more informative print-strings for our Tuples/Objects? <snip> > This leaves > > V{ ~vector~ ~vector~ } > > Again there is the opacity problem. What does the "~vector~" mean? And why > would I ever want to read such a general description of a 2-vector? It > doesn't say much about what is in the tree.
You're complaining about the fact that two different objects that you've built have uninformative representations when displayed on the stack. Taking the parser first, it seems that no-one has written a specific prettyprint implementation for the parser tuple. If you fancy doing so, it's not that much work: see [1]. For the second, consider the following snippet: 100 [ 0 ] V{ } replicate-as dup 2array This makes two vectors containing 100 zeros and then sticks them together in an array. They display on the stack as { ~vector~ ~vector~ } What would you prefer? If you want to see them in all their glory, now type "." ... and that's why that representation isn't used on the stack! For more information on what controls how the contents of the stack are printed short, look at the definition of s. . This ends up using pprint-short, which you can find online at [2]. Rupert [1] http://docs.factorcode.org/content/article-prettyprint-extension.html [2] http://docs.factorcode.org/content/word-pprint-short%2Cprettyprint.html
pgpWssmlPMfbS.pgp
Description: PGP signature
------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk