Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.14 KB

File metadata and controls

33 lines (22 loc) · 1.14 KB

java-pairs

Java CI Package

Functions for working with Pairs

import static io.hexlet.pairs.Pair.car;
import static io.hexlet.pairs.Pair.cdr;
import static io.hexlet.pairs.Pair.cons;
import static io.hexlet.pairs.Pair.pairToString;
import static io.hexlet.pairs.Pair.isPair;

Usage examples

var pair = cons(1, 2);

var one = car(pair); // one = 1;
var two = cdr(pair); // two = 2;

var isPair = isPair(pair); // isPair == true;

var result = pairToString(pair); // pair = "(1, 2)";

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet.