symbols

What is the difference between a variable and a symbol in LISP?

一个人想着一个人 提交于 2019-12-03 04:16:33
问题 In terms of scope? Actual implementation in memory? The syntax? For eg, if (let a 1) Is 'a' a variable or a symbol? 回答1: Jörg's answer points in the right direction. Let me add a bit to it. I'll talk about Lisps that are similar to Common Lisp. Symbols as a data structure A symbol is a real data structure in Lisp. You can create symbols, you can use symbols, you can store symbols, you can pass symbols around and symbols can be part of larger data structures, for example lists of symbols. A

Why are symbols not frozen strings?

偶尔善良 提交于 2019-12-03 04:15:25
问题 I understand the theoretical difference between Strings and Symbols. I understand that Symbols are meant to represent a concept or a name or an identifier or a label or a key, and Strings are a bag of characters. I understand that Strings are mutable and transient, where Symbols are immutable and permanent. I even like how Symbols look different from Strings in my text editor. What bothers me is that practically speaking, Symbols are so similar to Strings that the fact that they're not

Use special symbol (<, >) in layout design in Android

两盒软妹~` 提交于 2019-12-03 03:57:45
I need two navigation buttons with their texts are < and > . However, the compiler doesn't allow me use those symbols, even if I use \< and \> . Is there anyway to put these symbol into the XML design file? Use < for < Use > for > Use & for &. etc. Use < for < Use > for > Use & for & use " for " for complete List of symbol use &# decimal code of the symbol ; as above Enjoy Programming.. It is encouraged for Android programmers to store String values in res/values/strings. If you add a String here, you can reference it in your xml file like so: android:text="@string/mystring" Declare this in

How to create a symbol from a string that has whitespaces?

不想你离开。 提交于 2019-12-03 03:14:06
I am creating a Ruby hash for movie names storage. When the hash's keys are strings that contains whitespaces, it works just fine. As in: movies = {"Avatar" => 5, "Lord of the rings" => 4, "Godfather" => 4} Now I am trying to replace the use of strings with symbols: movies = {Avatar: 5, Lord of the rings: 4, Godfather: 4} Obviously that doesn't work. How does Ruby handle whitespaces in symbol naming? Try by yourself "Lord of the rings".to_sym #=> :"Lord of the rings" I'm not sure why you want to use symbols when you want spaces in the key values, but you can do that. You just can't do it using

Export a global symbol from a Delphi DLL

邮差的信 提交于 2019-12-03 02:37:23
I'm trying to create a Gecko 2.0-compatible DLL in Delphi. Previously (pre-Gecko 2.0) the DLL needed to export a NSGetModule() function. This worked flawlessly. Starting with Firefox 4, my DLL is getting loaded (I have verified this though a breakpoint in my initialization section), but my NSGetModule() function does not get called anymore. This is the designed behavior because starting with Gecko 2.0 (Firefox 4), a binary component is not supposed to export a NSGetModule() function: https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0#Binary_components According to these docs, my

Unfamiliar symbol in algorithm: what does ∀ mean? [closed]

£可爱£侵袭症+ 提交于 2019-12-03 01:25:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'm reading about an algorithm (it's a path-finding algorithm based on A*), and it contains a mathematical symbol I'm unfamiliar with: ∀ Here is the context: v(s) ≥ g(s) = min s'∈pred(s) (v(s') + c(s', s)) ∀s ≠ s start Can someone explain the meaning of ∀? 回答1: That's the "forall" (for all) symbol, as seen in

How to show π symbol on x axis?

為{幸葍}努か 提交于 2019-12-03 00:27:27
问题 Feel frustrated when I cannot add a simple "π" symbol on x axis. I searched lots of solution and there is what I use: set terminal postscript eps enhanced set output "test.eps" set xrange [-2*pi:2*pi] set sample 600 set xtics pi set mxtics 2 set xtics ("-2{/Symbol P}" -2*pi, "-{/Symbol P}" -pi, "0" 0, "{/Symbol P}" pi, "2{/Symbol P}" 2*pi) There is no "π" on the x axis! Am I wrong with any codes? or I missed any possible packages? Please see the xlabel below: Update: I tried lots of methods

What should I change to make this file compile?

旧巷老猫 提交于 2019-12-02 23:41:25
问题 I am in a programming class and this program is part of my homework. This file analyzes data from a file called "Names.txt" and then prints the information. I'm getting compilation errors and I want to know what I need to change or add to make it compile successfully. Here is my code: import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; public class NameApp { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); String selection,

Undefined symbols for x86_64 when compiling

跟風遠走 提交于 2019-12-02 22:57:28
问题 So I'm in an intro to Programming course in University and before anything else, let me say sorry for the poor formatting, I have no clue how to format this properly. But back to my questions, so we are primarily using c++ but I've been having some issues when I'm compiling my files. The compiler works for the most part and it will tell me when I have errors in my code but once I iron those out, it gives me a message saying that there are Undefined symbols for my x86_64 architecture. I tried

Why is this string key in a hash converted to a symbol?

℡╲_俬逩灬. 提交于 2019-12-02 20:09:14
Using Ruby 2.3: In example 1, the string key "a" is automatically converted to a symbol, whereas with example 2, it stays a string. Example 1 {"a": 1} # => {:a=>1} Example 2 {"a"=>"c"} # => {"a"=>"c"} I thought : was the same as the old style hash rocket => syntax. What is going on? Why have I never noticed this in Rails? Is it the HashWithIndifferentAccess that is obscuring this? In Ruby 2.3(.0), these are all the same: {:"a" => 1} {"a": 1}, {:a => 1} {a: 1} They all translate to the same thing: a is a symbol in all these cases. {"a"=>1} is different: a is a string in this case. It's because