Skip to content

Instantly share code, notes, and snippets.

View tmccombs's full-sized avatar

Thayne McCombs tmccombs

  • Lucid Software, Inc.
  • USA
View GitHub Profile

About variadics in Rust

This is an analysis of how variadic generics could be added to Rust. It's not a proposal so much as a summary of existing work, and a toolbox for creating an eventual proposal.

Introduction

Variadic generics (aka variadic templates, or variadic tuples), are an often-requested feature that would enable traits, functions and data structures to be generic over a variable number of types.

To give a quick example, a Rust function with variadic generics might look like this:

@tmccombs
tmccombs / prompt_thayne_setup.zsh
Last active October 26, 2018 18:46
Thayne's prompt theme
# vim: ft=zsh
#
# Thayne's custom prompt
prompt_thayne_setup () {
autoload -Uz vcs_info
local c=(cyan magenta)
PS1="%F{$c[1]}[%*]%(1V.%F{green}%1v.) %F{$c[1]}%-1<…<%~ %(?..%F{red}%B(%?%)%b)%<<
%f%h %(#.%F{red}#.%F{green}⮚)%f "
@jfhbrook
jfhbrook / libffi-unix.lisp
Created November 23, 2010 21:13
Gist action regarding installing gsll on fedora 12
;;;;Modify ~/quicklisp/dists/quicklisp/software/fsbv-20101006-git to look like
;;;;this:
;; CFFI-Grovel definitions for unix systems.
;; Liam Healy 2009-02-22 09:24:33EST libffi-unix.lisp
;; Time-stamp: <2009-08-23 09:51:01EDT libffi-unix.lisp>
;; $Id: $
(in-package :fsbv)