From 954580f8cac50cee9f91f894476cb531608b1657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Aulery?= Date: Mon, 28 Dec 2020 19:29:58 +0100 Subject: [PATCH] doc: fix titles (#7590) --- doc/docs.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/docs.md b/doc/docs.md index 37a1ba20e2..1725409d98 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -48,7 +48,6 @@ Anything you can do in other languages, you can do in V. -* [println and other builtin functions](#println-and-other-builtin-functions) * [Functions 2](#functions-2) * [Pure functions by default](#pure-functions-by-default) * [Mutable arguments](#mutable-arguments) @@ -56,6 +55,8 @@ Anything you can do in other languages, you can do in V. * [References](#references) * [Modules](#modules) * [Constants](#constants) +* [Builtin functions](#builtin-functions) +* [Printing custom types](#printing-custom-types) * [Types 2](#types-2) * [Interfaces](#interfaces) * [Enums](#enums) @@ -1646,6 +1647,8 @@ println([1,2,3]) // "[1, 2, 3]" println(User{name:'Bob', age:20}) // "User{name:'Bob', age:20}" ``` +## Custom print of types + If you want to define a custom print value for your type, simply define a `.str() string` method: