From 4b0c115b58211dcc063bcd09f8fe122e558b92ce Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 20 Oct 2015 18:52:12 -0400 Subject: literate programming introduced, tangle not yet run --- org/ao_object_setter.org | 131 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 org/ao_object_setter.org (limited to 'org/ao_object_setter.org') diff --git a/org/ao_object_setter.org b/org/ao_object_setter.org new file mode 100644 index 0000000..44c7c3e --- /dev/null +++ b/org/ao_object_setter.org @@ -0,0 +1,131 @@ +#+TITLE: Emacs config file written in org-mode +#+AUTHOR: Ralph Amissah +#+EMAIL: ralph.amissah@gmail.com +#+STARTUP: indent +#+LANGUAGE: en +#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil -:t f:t *:t <:t +#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc +#+OPTIONS: author:nil email:nil creator:nil timestamp:nil +#+OPTIONS: ^:nil _:nil#+OPTIONS: ^:nil _:nil +#+EXPORT_SELECT_TAGS: export +#+EXPORT_EXCLUDE_TAGS: noexport +#+TAGS: Amissah(A) Class(c) WEB(W) noexport(n) + +* object setter +** comment +#+name: ao_object_setter +#+BEGIN_SRC d :exports none +string[string] contents_comment(in string object) { + string[string] object_set; + object_set["use"] = "comment"; + object_set["of"] = "comment"; + object_set["is"] = "comment"; + object_set["obj"] = object; + return object_set; +} +#+end_src +** heading +#+name: ao_object_setter +#+BEGIN_SRC d :exports none +string[string] contents_heading( + in int type, + in string object, + in string attrib, + in int ocn, + in string lev, + in string lvn, + in string lcn, +) { + string[string] object_set; + object_set["use"] = "content"; + object_set["of"] = "para"; + object_set["is"] = "heading"; + object_set["type"] = to!string(type); + object_set["obj"] = object; + object_set["ocn"] = (ocn==0) ? "" : to!string(ocn); + object_set["lev"] = to!string(lev); + object_set["lvn"] = to!string(lvn); + object_set["lcn"] = to!string(lcn); + object_set["attrib"] = attrib; + return object_set; +} +#+end_src +** para +#+name: ao_object_setter +#+BEGIN_SRC d :exports none +string[string] contents_para( + in string type, + in string object, + in string attrib, + in int ocn, + in string indent_first, + in string indent_second, + in bool bullet +) { + string[string] object_set; + object_set["use"] = "content"; + object_set["of"] = "para"; + object_set["is"] = type; + object_set["obj"] = object; + object_set["ocn"] = (ocn==0) ? "" : to!string(ocn); + object_set["indent_first"] = indent_first; + object_set["indent_second"] = indent_second; + object_set["bullet"] = to!string(bullet); + object_set["attrib"] = attrib; + return object_set; +} +#+end_src +** block +#+name: ao_object_setter +#+BEGIN_SRC d :exports none +string[string] contents_block( + in string type, + in string object, + in string attrib, + in int ocn +) { + string[string] object_set; + object_set["use"] = "content"; + object_set["of"] = "block"; + object_set["is"] = type; + object_set["obj"] = object; + object_set["ocn"] = (ocn==0) ? "" : to!string(ocn); + object_set["attrib"] = attrib; + return object_set; +} +#+end_src +** block ocn string +#+name: ao_object_setter +#+BEGIN_SRC d :exports none +string[string] contents_block_ocn_string( + in string type, + in string object, + in string ocn, + in string node +) { + string[string] object_set; + object_set["use"] = "content"; + object_set["of"] = "block"; + object_set["is"] = type; + object_set["obj"] = object; + object_set["ocn"] = ocn; + object_set["node"] = node; + return object_set; +} +#+end_src + +* tangles +** code structure: :ao_object_setter.d: +#+name: tangle_ao_object_setter +#+BEGIN_SRC d :tangle ../lib/sdp/ao_object_setter.d :exports none :noweb yes +/* + object setter + ao_object_setter.d +*/ +mixin template ObjectSetters() { + class ObjectAbstractSet { + import std.conv : to; + <> + } +} +#+end_src -- cgit v1.2.3