functional programming - goto conference...protected methods: a protected method is similar to a...

128

Upload: others

Post on 23-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 2: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Functional Programmingin 40 minutes

@russolsen

Page 3: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 4: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 5: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Functional Programmingin 40 minutes

@russolsen

Page 6: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Functional Programming

Page 7: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Functional ProgrammingClojure spin

Page 8: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Functional Programming40 Minutes?

Page 9: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

What is it? What's it like? Does it work?

Page 10: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

What is it? What's it like? Does it work?

Page 11: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

FORGET Everything You Know About Programming

Page 12: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

What Do You Know?

Page 13: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration Procedures

Page 14: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration Procedures

Strings Numerics Booleans Indentation

Page 15: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration Procedures

Arrays HashesNamespaces

Strings Numerics Booleans Indentation

Page 16: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration Procedures

Classes Inheritance Methods

Arrays HashesNamespaces

Strings Numerics Booleans Indentation

Page 17: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration Procedures

Classes Inheritance Methods

Arrays HashesNamespaces

Programs

Strings Numerics Booleans Indentation

Page 18: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

FORGET Everything You Know About ProgrammingREALLY?

Page 19: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Functional Programming

Page 20: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Everything You Know About Programming

Refactor

Page 21: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 22: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 23: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 24: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 25: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 26: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 27: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 28: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 29: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

It Works But...

Page 30: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Mess

Page 31: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 32: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 33: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 34: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

What About Programming?

Page 35: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

During the type erasure process, the Java compiler erases all type parameters and replaces each with its first bound if the type parameter is bounded, or Object if the type parameter is unbounded.

https://docs.oracle.com/javase/tutorial/java/generics/genTypes.html

Page 36: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

During the type erasure process, the Java compiler

erases all type parameters and replaces each with its

first bound if the type parameter is bounded,

or Object if the type parameter

is unbounded.

Page 37: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit receiver, but that receiver is always  self (it’s defining class) or an object that inherits from self .

https://medium.com/@tjoye20/ruby-access-control-basics-public-vs-private-vs-protected-methods-7788b26e04a7

Page 38: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

A friend function of a class is defined outside that class' scope but it has the right to access all private and protected members of the class. Even though the prototypes for friend functions appear in the class definition, friends are not member functions.

https://www.tutorialspoint.com/cplusplus/cpp_friend_functions.htm

Page 39: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration Procedures

Classes Inheritance Methods

Arrays HashesNamespaces

Programs

Strings Numerics Booleans Indentation

Page 40: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Messy?

Page 41: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 42: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration

Arrays HashesNamespaces

Programs

Strings Numerics Booleans Indentation

Page 43: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 44: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 45: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 46: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 47: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 48: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 49: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 50: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

f(x)

Page 51: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

1

23

4

5

2

46 8

10

f(x)

Page 52: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

1

23

4

5

2

46 8

10

Page 53: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Procedures

Subroutines

Functions

Methods

Page 54: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

5 10

3 6

Page 55: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

5 42

3 6

10 ??

Page 56: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

5 10

36

Page 57: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

5 10

3 6

Page 58: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

f(x)A Thing

Page 59: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

f(x)A Thing I Can Make

Page 60: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

f(x)

Page 61: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

1st Class

Page 62: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Look at Input

Produce Output

Page 63: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

No Side Effects

Page 64: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

x = ['a','b','c']

y = a(x)

x = ?

Page 65: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

x = ['a','b','c']

y =

x = ?

c(a(x) + b(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + b(x)) + d(x) / c(a(x) + b(x)) + d(x) * e(x) + g(x) + h(x) *

floor(b(x)) + 16 * a(x) - ceil(g(x) - c(a(x) + b(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + b(x)) + d(x) / c(a(x) + b(x)) + d(x) * e(x) + g(x) + h(x) *

floor(b(x)) + 16 * a(x)

Page 66: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration

Arrays HashesNamespaces

Programs

Strings Numerics Booleans Indentation

f(x)

Page 67: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Problem

Page 68: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a b c

Page 69: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a b c

Page 70: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a Q c

Page 71: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

x = ['a','b','c']

y =

x = ?

c(a(x) + b(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + b(x)) + d(x) / c(a(x) + b(x)) + d(x) * e(x) + g(x) + h(x) *

floor(b(x)) + 16 * a(x) - ceil(g(x) - c(a(x) + b(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + b(x)) + d(x) / c(a(x) + b(x)) + d(x) * e(x) + g(x) + h(x) *

floor(b(x)) + 16 * a(x)

Page 72: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

t = c(a(x) + b(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + b(x)) + d(x) / c(a(x) + b(x)) + d(x) * e(x) + g(x) + h(x) *

floor(b(x)) + 16 * a(x) - ceil(g(x) x[2] = 'Q'

y = t + c(a(x) + b(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + b(x)) + d(x) / c(a(x) + b(x)) + d(x) * e(x) + g(x) + h(x) *

floor(b(x)) + 16 * a(x)

Page 73: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

t = c(a(x) + b(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) + b(x)) + d(x) / c(a(x) + b(x)) + d(x) * e(x) + g(x) + h(x) *

floor(b(x)) + 16 * a(x) - ceil(g(x)

x[2] = 'Q' y = t + c(a(x) + b(x)) + d(x) * e(x) - 4 * (q(x) - f(x)) +

d(x) * e(x) - 4 * (q(x) - f(x)) + b(x)) + d(x) / c(a(x) + b(x)) + d(x) * e(x) + g(x) + h(x) *

floor(b(x)) + 16 * a(x)

Page 74: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Immutable

Page 75: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a b c

a Q c

Page 76: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Problem

Page 77: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Copies Copies Copies

Page 78: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a b c d e f g h i j k l m n o p q r s t u v w x y z !

Page 79: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a b c d e f g h i j k l m n o p q r s t u v w x y z !

a b c d e f g h i j k l m Q o p q r s t u v w x y z !

Page 80: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Persistent Data Structures

Page 81: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a b c d e f g h i j k l m n o p q r s t u v w x y z !

Page 82: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a b c d e f g h i j k l m n o p q r s t u v w x y z !

Page 83: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

m Q o

Page 84: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

m X oQ

Page 85: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

m X oQ

Page 86: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

a b c d e f g h i j k l p q r s t u v w x y z !m X oQ

Page 87: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

3

Page 88: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

3

Page 89: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration

Arrays* Hashes*Namespaces

Programs

Strings Numerics Booleans Indentation

f(x)

Page 90: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Problem

Page 91: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Side Effects

Page 94: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 95: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

57Atoms

Page 96: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

57f(x)

Atoms

Page 97: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

58f(x)

Atoms

Page 98: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

59f(x)

g(x)

Atoms

Page 99: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

59f(x)

g(x)

Atoms

g(x)

Page 100: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

some_code(queue)

Agents/Actors

f(x)

g(x)

Page 101: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration

Arrays* Hashes*Namespaces

Programs

Strings Numerics Booleans Indentation

f(x)

Page 102: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

What is it? What's it like? Does it work?

Page 103: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Magic

Page 104: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Magic

Page 105: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

You still have off-by-one errors

Page 106: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

You still have REDUNDANT code

Page 107: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

BAD CODE

Page 108: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

The database is STILL DOWN

Page 109: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Threads!

Page 110: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 111: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 112: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

What is it? What's it like? Does it work?

Page 113: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

pedestal.io

Page 114: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 115: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

What is Pedestal?Pedestal is a set of libraries that we use to build services and applications. It runs in the back end and can serve up whole HTML pages or handle API requests.

Page 116: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

18,706lines

Page 117: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

28protocols

+

Page 118: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

8bridges to the stateful world

Page 119: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

9Record types

+

Page 120: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

1multi method

+

Page 121: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

944functions

f(x)

Page 122: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 123: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Name = ValueNames Ifs Iteration

Arrays* Hashes*Namespaces

Programs

Strings Numerics Booleans Indentation

f(x)

Page 124: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

YES

Page 125: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

Questions?

Page 126: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit

@russolsen

Page 127: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit
Page 128: Functional Programming - GOTO Conference...Protected methods: a protected method is similar to a private method, with the addition that it can be called with, or without, an explicit