|
|
fu
created at Sunday, 2010-06-06, 07:02:07
0 Replies, 176 Hits
fu
created at Sunday, 2010-06-06, 01:41:14
fu
modified at Sunday, 2010-06-06, 03:11:40
2 Replies, 275 Hits
Summary of the recent development of DaoBesides many bug fixings and some optimizations, Dao has undergone some interesting developments to support some new features. Here is a brief summary of these features: ...(Full text)
fu
created at Friday, 2010-05-21, 06:47:28
fu
modified at Friday, 2010-05-21, 06:49:39
0 Replies, 296 Hits
A quine program is a program that prints out the source codes of itself. To be more fun, the source codes should not be read from the source file, nor should it be stored in some kind of global variable from which to be accessed. An interesting quine program should reconstruct its source codes programatically in some way. A list of quine programs in other languages can be found one RosettaCode .
A simple quine program in Dao can be produced easily by porting the C implementation in C to Dao. But the more interesting way is to write a quine using Dao macros: ...(Full text) fu
created at Tuesday, 2010-05-11, 05:36:48
0 Replies, 305 Hits
fu
created at Sunday, 2010-04-25, 21:43:22
4 Replies, 481 Hits
(I slept badly last night because these thoughts came into my mind just before sleeping. Luckily these thoughts seem well to be useful. Sometimes I found myself repeating some thoughts almost subconsciously, probably it's because I was subconsciously afraid I would forget those thoughts or they were not concrete enough, writing them down should relieve this:-))
Dao supports function overloading, which imposes a significant overhead to function call, because when a function is called, the parameters have to be checked against the parameter types of a list of overloaded functions. Such checking is time consuming. One possible way to solve this is to encode function prototypes into string, and encode the calling parameter ...(Full text) fu
created at Sunday, 2010-04-25, 05:40:10
fu
modified at Sunday, 2010-04-25, 05:51:59
0 Replies, 361 Hits
A new feature has just been added to the Dao macro system,
this new feature allows defining python style
indentation sensitive syntax. It is pretty simple to do this now, an example
with explanation is available in the svn on google code:
demo/macro/scoping_by_indentation.dao
The key point is to use $IBL prefixed macro variable instead of $BL prefixed variable, to match Indented code BLock, which means the matching is stopped once a line with indentation narrower than the indentation of the first matched line. Another key point is to use indentation alignment @X marker to force all tokens followed by the same marker to have the same indentation. This is need to properly handle if-elif-else constructs. Just for ...(Full text) fu
created at Sunday, 2010-04-25, 05:23:49
0 Replies, 227 Hits
(As you can probably see, usually I am too lazy to write down my ideas. I used to keep them in my mind for plenty of time until they become clear enough to be written down quickly as implementation codes. But from time to time, I am asked what is the development plans for Dao or what are the planned features. So I might begin to write down some ideas down from time to time. Hope that there will be some interesting feedbacks.)
The following I am going to write is already ready for implementation. It will be a type called interface , which can be related to prototype oriented programming. An interface is defined as a set of member methods which can be called upon an object. Similar to class , interface will support inheritance, and can declare member methods. But it will not allow implementation of its member methods. Example, ...(Full text)
fu
created at Saturday, 2010-04-03, 07:00:38
0 Replies, 307 Hits
这个例子可以在道语言在google code上的svn源码仓库里下载:http://code.google.com/p/dao-language/source/browse/#svn/trunk/demo/embedding 。
这例子展示了如何封装c函数和c++类。这个封装允许从c++类派生出dao语言类,并支持dao语言派生类重新实现c++类里的虚函数。这些封装代码是由autobind.dao工具自动生成的,因此,如果你想知道其他数据类型或函数该如何封装,你可以将它们写入到 greeting.h 头文件里,然后运行 make bind , 再查看自动生成的封装代码! 这个例子也演示了如何嵌入dao,并恰当的使用dao语言的c接口运行保存在字符串里的道语言代码。此例子仅仅是作为一个起点,若要更多地了解dao语言的c接口编程,可参看道库的头文件 dao.h 和相关文档(如: 使用道语言的C函数接口编程 )。 ...(Full text) fu
created at Saturday, 2010-04-03, 06:39:04
0 Replies, 328 Hits
The codes for this example can be found in the svn repository of Dao on Google Codes: http://code.google.com/p/dao-language/source/browse/#svn/trunk/demo/embedding .
This example shows how to wrap C functions and C++ classes. The wrapping can allow deriving Dao classes from C++ classes with the possibility to re-implement C++ virtual functions. The wrapping codes are generated by the autobind.dao tool, so if you want to know how other data types and functions should be wrapped, just put them in the greeting.h file and then run make bind , the generated codes will show you how to wrap them! This example also shows you how to embed Dao, and use proper C interfaces of Dao to run Dao scripts stored in C string. It can be used as a starting point, to get to know more about the C interfaces of Dao, one may simply look into the head file dao.h of the Dao ...(Full text) fu
created at Sunday, 2010-03-21, 23:02:36
1 Replies, 391 Hits
|
fu: Many thanks (Jul.04,04:29) klabim: fixed Hi, great, now my test works now :- ). (Jun.30,17:51) Nightwalker: Few suggestions (Jul.03,14:37) |