This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rational; | |
import std.conv : to; | |
import std.algorithm; | |
import std.stdio; | |
import std.traits; | |
import matrix; | |
import vector; | |
ElementType pow(ElementType, I)(ElementType number, I power) if (isIntegral!I) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application { | |
window width=1280 height=800 caption="Example project" layout="docking" { | |
widget dock="fill" layout="absolute" { | |
-- This 'caption' property will be assigned to 'text' property of frame.header.caption widget as stated in frame template. | |
-- Also layout will not affect frame widget itself. It will be applied to frame.contentArea, because | |
-- later is marked as 'children-container' inside frame template. | |
frame pos="0 0" caption="Test frame. Uses template!" layout="docking" { | |
text-button dock="top" text="Click me" | |
line-edit dock="top" text="Edit me" | |
text-check dock="top" text="check me" check-group=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class IProperty | |
{ | |
// called when value changes. | |
alias PropertyChangedSignal = Signal!(FlexibleObject, Variant); | |
alias PropertyChangingSignal = Signal!(FlexibleObject, Variant*); | |
Variant value() @property; | |
Variant value(Variant) @property; | |
ref PropertyChangedSignal valueChanged() @property; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IProperty firstName, lastName, fullName; | |
// fetch properties from widgets. | |
auto converter = (Variant firstName, Variant lastName){ | |
return Variant(firstName ~ " " ~ lastName); | |
}; | |
fullName.pipeFrom(cast(Variant delegate(Variant[]...))converter, firstName, lastName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dasm < stmt* eoi | |
lines <- (stmt )* | |
stmt <- basicOpcode / specOpcode / preStmt | |
preStmt <- | |
basicOpcode <- opcode expr, expr | |
specOpcode <- opcode expr | |
expr <- Arithmetic / Id | |
Id <- | |
.include "file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module moddable; | |
import std.stdio; | |
import std.exception : enforce; | |
import std.datetime; | |
import core.thread : Thread; | |
/// Basic module interface. | |
interface IModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module modular.modules.eventdispatchermodule; | |
import modular; | |
// Basic event | |
abstract class Event | |
{ | |
bool continuePropagation = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dmd -debug -g app.d imodule.d | |
del app.obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* file: "tinyc.d" */ | |
/* Copyright (C) 2001 by Marc Feeley, All Rights Reserved. */ | |
// D port by Mr.Smith (C) 2014 | |
import std.stdio; | |
import std.algorithm : equal; | |
/* | |
* This is a compiler for the Tiny-C language. Tiny-C is a |
OlderNewer