FIRST

Syntax

FIRST word or list

Explanation

FIRST outputs the first element of its input. If the input is a word, FIRST outputs the first character. If the input is a list, FIRST outputs the first element of that list.

See also BUTFIRST, BUTLAST, and LAST.

Examples

? FIRST "TOADSTOOL

Result: T

? FIRST [TABLE CHAIR STOOL]

Result: TABLE

? FIRST FEBRUARY 14][APRIL 26][JUNE 19

Result: [FEBRUARY 14]

?

? TO INITIALS :LIST

>        IF :LIST = [] STOP

>       PR FIRST FIRST :LIST

>       INITIALS BF :LIST

> END

INITIALS defined.

? INITIALS[INTERNATIONAL BUSINESS MACHINES PERSONAL COMPUTER]

I

B

M

P

C

?