Skip to content

Instantly share code, notes, and snippets.

module widget.attempt5.curved;
import widget.attempt5.model;
void drawCurvedBorder(DrawContext)(ref DrawContext context) {
if (!context.model.dropShadow.isNull)
dropShadow!DrawContext(context);
// four buffers that store the current locations for each horizontal side (to be built upon)
// lets setup the initial indexes into the first of buffers with respective to horizontal side
@rikkimax
rikkimax / curved.d
Created December 13, 2019 16:57
attempt4.d
module widget.attempt4.curved;
import widget.attempt4.model;
import widget.attempt4.utils : plotEllipse;
enum WithDecorations = true;
void drawCurvedBorder(DrawContext)(ref DrawContext context) {
if (!context.model.dropShadow.isNull)
dropShadow(context);
DoublyLinkedList!Something global; // error,
//DoublyLinkedList!Something contains headconst fields and is not marked as such (globals can't be anyway)
//also its null (=void wouldn't work either since then it wouldn't be tied to a stack)
void func() @system {
DoublyLinkedList!Something ll = new DoublyLinkedList!Something(); // ok in @system code but won't allow escaping because of headconst fields.
headconst DoublyLinkedList!Something ll = new DoublyLinkedList!Something(); // ok
ll.add(Something.init);
  • Augment example struct Map(@named alias Function, @named InputType, @named ElementType) with a less exagerated signature.
auto map(alias Function, InputType)(InputType input) {
	return Map!(Function, InputType)(input);
}

struct Map(alias Function, InputType,
	@named ElementType = ElementType!InputType)
///
struct LFSR113 {
///
enum bool isUniformRandom = true;
///
enum auto empty = false;
///
@property {

Named parameters

Field Value
DIP: 1020
Review Count: 1
Author: Richard Andrew Cattermole [email protected]
Implementation:
Status: Post-Community 1

TODO: some form of introductory paragraph about what goes under this

Requirements

Use cases

Semantics

import wg.util.allocator;
import std.traits : isPointer, isBasicType;
struct Optional(T) if (isBasicType!T || is(T == struct) || is(T == union)) {
@disable this(this);
this(Allocator* allocator) {
this.allocator = allocator;
}
@rikkimax
rikkimax / points.md
Last active April 4, 2019 18:47
DIP 1020 review 1
  • Angle brackets, may be hard to find given relationship with templates Potential solutions include @named
  • External access of template parameters externally needs justification
  • Interaction with eponymous templates, invalid
  • "Future proposals" sections should probably have a full rewrite to indicate its for recognizing desirable semantics that are out of scope.
  • Not in competition with in place struct initialization, different purposes
  • More headings (break down behavior)
  • Reorder of arguments does not change at symbol site, only at the argument side
  • Overload resolution code is flawed with illegal code
  • Compare and contrast example code
/**
* LV2 Client implementation
*
* Copyright: Ethan Reker 2018.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
*/
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2018 Filipe Coelho <[email protected]>