------编写Ruby扩展
原文:http://qiezi.javaeye.com/blog/26632
关键字: ruby 扩展
Ruby语言的官方解释程序是使用C语言开发的,一般用C语言来编写扩展。D语言和C语言是二进制兼容的,所以可以使用D语言编写Ruby扩展。
一、移植C库到D的一般过程
C使用头文件来处理符号依赖,在D里面链接外部库文件时,要使用extern (C)声明来引入符号,这是一个转换过程。
如何转换一个C头文件到D文件?D文档的htomodule.html有详尽说明。一般的转换过程如下:
1、运行预处理程序处理掉头文件里面的宏。
2、删除经过预处理以后的多 ...
原文:http://ideage.javaeye.com/blog/26718
关键字: D 导入库 HTOD
要使用D,就要和其他应用配合。D和C是二进制兼容的。可以转换C的头文件为D的文件,然后访问C的库,或者兼容C的库。
步骤:
1.转换C的头文件。具体办法http://www.digitalmars.com/d/htomodule.html,也可以使用HTOD工具 http://www.digitalmars.com/d/htod.html,下载在http://ftp.digitalmars.com/d/htod.zip
2.转换动态库,生成D可以链接的lib文件,D链接的格式是I ...
这几天摸到鼠标就有点恶心了,听说是患了鼠标手了,一查还真是,现在每天还得练螳螂拳了http://news.jkkey.cn/news/07/12/1198563286,90713.shtml,有这毛病的一定得多点锻炼,记得吃饭,否则你也差不多了。翻译看来有点难以为继了,好好练语法,学到一点贴一点,这样还是可行的。内容多了再来整理。
就按如下次序吧。
* object
std
* std.algorithm
* std.base64
* std.bigint
* std.bind
* std.bitarray
* std.bit ...
- 14:03
- 浏览 (29)
- 评论 (0)
- 分类: Phobos 2.0
Jump to: TypeClass Bool Integer Float Complex Imaginary Class Pointer Array Other Box unboxable type data toString opEquals opCmp toHash box boxArray boxArrayToArguments UnboxException object outputType unboxCastReal unboxCastInteger unboxCastComplex unboxCastImaginary unbox
This module is a set o ...
- 22:26
- 浏览 (32)
- 评论 (0)
- 分类: Phobos 2.0
Jump to: bitfields FloatRep DoubleRep BitArray opIndex opIndexAssign dup opApply reverse sort opEquals opCmp init opCast opCom opAnd opOr opXor opSub opAndAssign opOrAssign opXorAssign opSubAssign opCatAssign opCat opCat_r
Bit-level manipulation facilities.
Authors:
Walter Bright, Andrei Alexand ...
- 22:24
- 浏览 (25)
- 评论 (0)
- 分类: Phobos 2.0
Jump to: bind _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 Tuple appendT append prependT prepend concatT type value tuple isTypeTuple minNumArgs BoundFunc bindAlias
Bind function arguments to functions.
References:
boost::bind
Authors:
Tomasz Stachowiak
Date:
November 28, 2006
const DynArg!(0) _0;
cons ...
- 22:22
- 浏览 (23)
- 评论 (0)
- 分类: Phobos 2.0
Jump to: base64 Base64Exception Base64CharException encodeLength encode decodeLength decode
Encodes/decodes MIME base64 data.
References:
Wikipedia Base64
RFC 2045
class Base64Exception: object.Exception;
class Base64CharException: std.base64.Base64Exception;
uint encodeLength(uint sl ...
- 22:21
- 浏览 (24)
- 评论 (0)
- 分类: Phobos 2.0
std.algorithm
Jump to: algorithm map reduce filter inPlace move swap overwriteAdjacent find findRange findBoyerMoore findAdjacent findAmong findAmongSorted canFind canFindAmong canFindAmongSorted count equal overlap min max mismatch EditOp none substitute insert remove levenshteinDistance levenshtei ...
- 22:20
- 浏览 (28)
- 评论 (0)
- 分类: Phobos 2.0
JFace Text Editor是JFace里面一个功能强大,结构复杂而且非常重要的组件,要掌握它还需要花不少的功夫,下面我们将通过"Building an Eclipse Text Editor with JFace Text"的翻译来掌握它的用法。
JFace Text Editor完全掌握之终极指南(1)
http://macrochen.javaeye.com/blog/143308
JFace Text Editor完全掌握之终极指南(2)
http://macrochen.javaeye.com/blog/143312
JFace Text Editor完全掌握之终极指 ...
- 01:57
- 浏览 (62)
- 评论 (0)
- 分类: swt & jface
- 浏览: 5429 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
我的相册
最近加入圈子
链接
最新评论
-
三言两语
看看有没有all.d这个文件,dwt中好像没有这个文件(ddbi中有),这个文件 ...
-- by hqs7636 -
SWT 全接触
我本来是不想说话的. 但是看到好贴子. 我不得不说一个好字.. 为什么这么好的贴 ...
-- by Wallian_hua -
三言两语
大哥,我这里的D程序里面只要有import dwt.all;或者其它的.all就 ...
-- by huangzongwu -
Traits 特征 2.014
哈哈,漂亮,是有点信达雅的意思,谢谢。我翻译的有点像文言文
-- by hqs7636 -
Traits 特征 2.014
我理解的意思就是指虚函数,因为经过重载override的函数还是虚函数。 在这 ...
-- by Colorful






评论排行榜