Questions tagged [symbols]

can refer to a letter or special character; a primitive data type in many programming languages; an item of the alphabet of a formal language.

Symbol can refer to:

  • A letter or special character, e.g. '@'. Questions about character processing or dealing with specific characters can be tagged with this tag.
  • A primitive data type in many programming languages (Lisp, Prolog, Ruby, Smalltalk etc.)
  • An item of the alphabet of a formal language.
3495 questions
78
votes
10 answers

What's the difference between a string and a symbol in Ruby?

What's the difference between a string and a symbol in Ruby and when should I use one over the other?
readonly
  • 343,444
  • 107
  • 203
  • 205
74
votes
11 answers

Missing symbol names when profiling IPhone application with Instruments

I am compiling an iPhone application via command line (so no Xcode options involved) however I am unable to get my symbol names to show when profiling with Instruments. I have tried several flags such as -gdawrf-2 and -g without any success. I have…
Mac Twist
  • 1,161
  • 1
  • 8
  • 7
72
votes
11 answers

Rails load YAML to hash and reference by symbol

I am loading a YAML file in Rails 3.0.9 like this: APP_CONFIG = YAML.load(File.read(File.expand_path('../app.yml', __FILE__))) It loads the all of the contents like hierarchical hashes, no problem. The part I don't like is the fact that the hashes…
Michael K Madison
  • 2,242
  • 3
  • 21
  • 35
71
votes
3 answers

Purpose of Scala's Symbol?

Possible Duplicate: What are some example use cases for symbol literals in Scala? What's the purpose of Symbol and why does it deserve some special literal syntax e. g. 'FooSymbol?
soc
  • 27,983
  • 20
  • 111
  • 215
70
votes
5 answers

readelf-like tool for Mac OS X?

Is there a tool for reading Mac OS X binaries that would print information about relocation tables and symbol offsets similar to this readelf output? readelf -r app Relocation section '.rel.dyn' at offset 0x5ec contains 2 entries: Offset Info …
karlphillip
  • 92,053
  • 36
  • 243
  • 426
69
votes
5 answers

Why is it not a good idea to dynamically create a lot of symbols in ruby (for versions before 2.2)?

What is the function of symbol in ruby? what's difference between string and symbol? Why is it not a good idea to dynamically create a lot of symbols?
Ikbear
  • 1,267
  • 3
  • 15
  • 17
68
votes
4 answers

What does a double colon followed by an equals sign (::=) mean in programming documentation?

What does ::= mean in programming documentation? For example in the Lua documentation: or in Python documentation.
Charles Holbrow
  • 3,967
  • 6
  • 30
  • 35
68
votes
2 answers

What does the Ruby method 'to_sym' do?

What does the to_sym method do? What is it used for?
keruilin
  • 16,782
  • 34
  • 108
  • 175
68
votes
5 answers

What does the SQL # symbol mean and how is it used?

Can someone please explain to me what the # symbol means in MS SQL Code. I've tried Googling it, and even searching on StackOverflow, but can't seem to find the answer. I feel like an idiot - having one of "those" days. Please help.
Saajid Ismail
  • 8,029
  • 11
  • 48
  • 56
67
votes
4 answers

What Unicode symbol represents a person?

Does there exist a Unicode symbol that represents a person? I would expect something like this: I need a short way to represent a price per person, such as “25€/person”, but with the word “person” replaced with a Unicode character for a person. The…
jbaylina
  • 4,408
  • 1
  • 30
  • 39
65
votes
4 answers

What are the meanings of the columns of the symbol table displayed by readelf?

Could someone explain the columns shown of the symbol table using readelf?
Swaroop S
  • 691
  • 1
  • 5
  • 7
63
votes
8 answers

Duplicate symbol issues

During a refactor of an iOS project, I ran into this bear of a bug. During the linking phase, I get this message: ld: duplicate symbol _OBJC_IVAR_$_TinCanViewController.currentViewController in /path/to/TinCanViewController-E98A666B7AF2673A.o and…
drewww
  • 2,485
  • 4
  • 22
  • 24
63
votes
1 answer

Undefined Symbols for architecture x86_64: Compiling problems

So I am trying to start an assignment, my professor gives us a Main.cpp, Main.h, Scanner.cpp, Scanner.h, and some other utilities. My job is to create a Similarity class to compare documents using the cosine and Jaccard coefficients. However, I can…
Trevor Hutto
  • 2,112
  • 4
  • 21
  • 29
63
votes
4 answers

What does to_proc method mean in Ruby?

I am learning rails and following this thread. I am stuck with the to_proc method. I consider symbols only as alternatives to strings (they are like strings but cheaper in terms of memory). If there is anything else I am missing for symbols, then…
swapnesh
  • 26,318
  • 22
  • 94
  • 126
63
votes
8 answers

Practical examples of using symbols in Scala?

Scala has symbols - names that start with a single quote ' and which are a kind of string constants. I know symbols from Ruby (where they start with a colon). In Ruby they are used for some meta-programming tasks, like generating getters and setters…
Jesper
  • 202,709
  • 46
  • 318
  • 350