<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: YAML&#8217;s Missing Type</title>
	<link>http://www.ionous.net/2007/01/31/yamls-missing-type/</link>
	<description>all you never wanted to know about game programming.</description>
	<pubDate>Wed, 07 Jan 2009 13:43:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: simon travis</title>
		<link>http://www.ionous.net/2007/01/31/yamls-missing-type/#comment-43</link>
		<pubDate>Sat, 10 Mar 2007 16:00:14 +0000</pubDate>
		<guid>http://www.ionous.net/2007/01/31/yamls-missing-type/#comment-43</guid>
					<description>I hear what you are saying and i think, perhaps, we are not far off in our views on this.

Part of the question is who should do the type conversion, and the other part is what should happen if the types in the file don't match the expected types.

Ideally, I think a parser would come in two parts.  A low level parser, and then an extensible set of type converters.  The statically-type application would have structures with a fixed set of fields, so to read in any particular value it would fetch the node from the parser, and then use the type converters to marshal that node into application's desired type.  My simple example in the post --  node.ConvertToFloat() -- was definitely bad, because that level of declaration doesn't allow for any extensibility; there'd be no way for the app to participate in the conversion when it needs to(!).

My actually sample parser has a simple two level setup but I didn't reflect that into this post well.

It definitely would make sense for the converter layer to throw or return some sort of continuable error to make sure the application knows that something strange is going on any time the application asks for a type that doesn't match the node type.

My sample parser doesn't provide a good facility for that -- the converter layer is too simple, and could probably use some work.</description>
		<content:encoded><![CDATA[<p>I hear what you are saying and i think, perhaps, we are not far off in our views on this.</p>
<p>Part of the question is who should do the type conversion, and the other part is what should happen if the types in the file don&#8217;t match the expected types.</p>
<p>Ideally, I think a parser would come in two parts.  A low level parser, and then an extensible set of type converters.  The statically-type application would have structures with a fixed set of fields, so to read in any particular value it would fetch the node from the parser, and then use the type converters to marshal that node into application&#8217;s desired type.  My simple example in the post &#8212;  node.ConvertToFloat() &#8212; was definitely bad, because that level of declaration doesn&#8217;t allow for any extensibility; there&#8217;d be no way for the app to participate in the conversion when it needs to(!).</p>
<p>My actually sample parser has a simple two level setup but I didn&#8217;t reflect that into this post well.</p>
<p>It definitely would make sense for the converter layer to throw or return some sort of continuable error to make sure the application knows that something strange is going on any time the application asks for a type that doesn&#8217;t match the node type.</p>
<p>My sample parser doesn&#8217;t provide a good facility for that &#8212; the converter layer is too simple, and could probably use some work.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alexey Zakhlestin</title>
		<link>http://www.ionous.net/2007/01/31/yamls-missing-type/#comment-42</link>
		<pubDate>Sun, 04 Mar 2007 09:42:14 +0000</pubDate>
		<guid>http://www.ionous.net/2007/01/31/yamls-missing-type/#comment-42</guid>
					<description>I believe you are wrong on this subject, as in statically-typed language you should get &quot;type mismatch&quot; error if something goes wrong, and it actually is left to your application to do all the casts, not the library.</description>
		<content:encoded><![CDATA[<p>I believe you are wrong on this subject, as in statically-typed language you should get &#8220;type mismatch&#8221; error if something goes wrong, and it actually is left to your application to do all the casts, not the library.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
