Skip to content

Instantly share code, notes, and snippets.

View p2025-discussion.md

A summary of previous discussions on P2025

Objections to the proposal

Disclaimer: I’m undoubtedly biased. You can find the original opinions in the thread “P2025R1: issues fixed?”, 13/05/2020 to 20/05/2020.

1. The proposed language rules are too complex.

The wording consists of two major parts:

@Anton3
Anton3 / layout_generator.kt
Last active Mar 12, 2020
Needs "books.txt" in the resources directory. Try experimenting with weights on line 136
View layout_generator.kt
package name.anton3.layout
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.abs
class Dummy
fun readResource(name: String): String {
return Dummy::class.java.classLoader.getResource(name)!!.readText()
View abbr-lambdas.md

Alternative abbreviated lambdas

Introduction

This paper provides an alternative abbreviated lambda expression syntax, as well as an alternative syntax for transparent functions, compared to [@P0573R2].

Motivation and scope

[@P0573R2] introduces a notion of transparent functions, which aim to behave as close as possible to as if their body was directly inserted into the caller (except that their arguments are only computed a single time).

View alias-expressions.md

Alias expressions

Summary

Alias expressions allow setting up a constructed object before returning it from a function or passing it as a function argument, while incurring no copies or moves.

Motivation

Sometimes we want to create an object, set it up and return it.

View SinglePolyUnwrappedDeserializer.kt
package name.anton3.vkapi.generator.json
import com.fasterxml.jackson.annotation.JsonUnwrapped
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.*
import com.fasterxml.jackson.databind.deser.ContextualDeserializer
import com.fasterxml.jackson.databind.deser.ResolvableDeserializer
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
import com.fasterxml.jackson.databind.node.ObjectNode
import com.fasterxml.jackson.databind.node.TreeTraversingParser
@Anton3
Anton3 / after_inlining.cpp
Created Jul 25, 2019
Inlining coroutines
View after_inlining.cpp
task<void> foo() {
co_return uninlineable_mess();
}
@Anton3
Anton3 / typed-throws.md
Last active Feb 18, 2017
Draft of "Typed throws" proposal
View typed-throws.md

Allow Type Annotation on Throws

Introduction

Typed throws annotation specifies that a function can only throw errors of a certain type:

View mixins.swift
// Feature 1: @mixin extension
struct Pizza {
var containsCheese: Bool
init(cheese: Bool) { ... }
func prepare() { print(self) }
}
struct Margherita {
var pizza: Pizza
init() { pizza = Pizza(cheese: true) }
View NNNN-separate-bitwise-precedence.md

Feature name

Introduction

Bitwise and arithmetic operators are very different, and their precedence relationship is not obvious.

View 9999-ifcaseguardcase.md

Simplifying guard case/if case syntax

  • Proposal: TBD
  • Author: Erica Sadun
  • Status: TBD
  • Review manager: TBD

Introduction

This proposal re-architects guard case and if case grammar for unwrapping complex enumerations. It drops the case keyword from if and guard, replaces = with ~=, and introduces the := operator that combines declaration with assignment.