What does the question mark in Erlang syntax mean?
For example:
Json = ?record_to_json(artist, Artist).
The full context of the source can be found here.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Erlang uses question mark to identify macros. For e.g. consider the below code:
As the documentation says,
This snippet defines a macro called
DEBUGthat is replaced with a call to print a string ifdebugis set at compile time. The macro is then used in the following code thus:This statement is expanded and replaced with the appropriate contents if
debugis set. Therefore you get to see debug messages only ifdebugis set.Update
Thanks to @rvirding: