Erlang record syntax with single quotes
Asked Answered
D

2

5

Can someone explain the single quotes (' ') in this Erlang record syntax?

#'queue.declare'{queue = <<"hello">>}
Dogvane answered 22/2, 2014 at 7:51 Comment(0)
D
16

In this expression, 'queue.declare' is the record's name, and therefore must be an atom.

An atom should be enclosed in single quotes (') if it does not begin with a lower-case letter or if it contains other characters than alphanumeric characters, underscore (_), or @.

Drain answered 22/2, 2014 at 8:0 Comment(0)
C
0

's are for atoms and "s are for strings. 's and "s are not interchangeable, so use them in the appropriate places.

If you want to read more, read: http://www.erlang.org/doc/reference_manual/data_types.html

Commode answered 30/9, 2014 at 16:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.