Measures Concepts
GitHub icon

Functions

Functions - language feature

< >
Example from JavaScript, TypeScript:
function helloWorld() {console.log("hi")}
Example from Pug:
mixin article(title) .article .article-wrapper h1= title if block block else p No content provided +article('Hello world') +article('Hello world') p This is my p Amazing article
Example from Speedie:
function Example (|string| data) file <~ data
Example from Jule:
fn a_function() { // ... }
Example from Bel:
(fn (x) (+ x 1))
Example from Cyber:
func fib(n int) int: coyield if n < 2: return n return fib(n - 1) + fib(n - 2)
Example from BALGOL:
FUNCTION TORADS(DEGREES) = DEGREES . 3.1415926/180$

Languages with Functions include JavaScript, Python, PHP, Ruby, R, Scala, Ada, Kotlin, PowerShell, TypeScript, Lua, Julia, Bash, Erlang, Solidity, Verilog, Reason, Crystal, F#, OCaml, Groovy, VHDL, Pug, ABAP, X10, Opa, F*, SystemVerilog, Cython, ATS, C3, Speedie, janet, Koka, progsbase, IGOR Pro, Jule, Bel, Eclipse Command Language, Cyber, Q#, Ligo, Sophia, BALGOL

Languages without Functions include CSS

This question asks: Does the language have a concept of and syntax for functions?

Read more about Functions on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Day 605 feedback@pldb.io Logout