[erlang-questions] atoms used as status info, 'constants' etc

Mingyan Wang mingyan.wang@REDACTED
Tue Aug 18 09:37:45 CEST 2009


Hi Dave,

Define the constants in a hrl file.
E.g.
-define(status_a,"status_a").

Include this hrl file in your erl file and then you can use this syntax ?status_a.
E.g.
case Status of
 ?status_a -> 
......

 

-----Original Message-----
From: erlang-questions@REDACTED [mailto:erlang-questions@REDACTED] On Behalf Of Dave Pawson
Sent: 2009年8月18日 15:27
To: Erlang Questions
Subject: [erlang-questions] atoms used as status info, 'constants' etc

I'm using atoms as status value returns from functions.
Is there any 'best practice' in this area?
  In other languages I might keep them together as defined constants or some such?

TIA

--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html erlang-questions (at) erlang.org



More information about the erlang-questions mailing list