Search results
Top results related to what is the difference between currency symbol and iso 4217 code
Top Answer
Answered Aug 12, 2019 · 3 votes
Symbols are, at the simplest level, names with identity. That's what you want in any programming language for identifiers: if, when the compiler is looking at some code, it sees some variable name foo it needs to know that it is the same variable as some other name foo elsewhere in the program (subject to the scope & extent rules of the language of course). Implementationally this means that that symbols get interned into some kind of table so that you can answer questions like 'is this thing the same as that thing?' and 'have I already seen this thing?' very quickly. In particular at the point where you have a sequence of characters which you've decided is going to be the name of a symbol, then you look up that name in the table, and if it's there you use the existing symbol, while if it's not you make a new symbol, store it in the table, and return that.
Large numbers of programming language implementations use some kind of symbol structure and one or more symbol tables (the process of linking is substantially the process of establishing that pairs of symbols are in fact the same symbol for instance, so things in libraries (named by symbols) can get associated with references to them (named by symbols).
But programming languages which want to talk about programming languages often expose symbols as objects at the language level, because this is just obviously useful. Lisp and Scheme (or 'Lisp-family languages' or however you want to divide things up) are one of the canonical examples of programming languages which are about programming languages.
I am not as familiar with Scheme standards as I should be (I'm a Racket & CL person), but:
- string->symbol takes a string and returns a possibly-newly-constructed symbol with that name, which is interned, returning an identical symbol each time it is called with a string with the same sequence of characters;
- symbol->string takes a symbol and tells you its name, which is a string.
So in particular it is the case that
(eq? (string->symbol "foo") (string->symbol "foo"))-
is true. And even more strongly
(eq? (string->symbol (make-string 3 #\f)) (string->symbol (make-string 3 #\f)))-
is true. However
(eq? (make-string 3 #\f) (make-string 3 #\f))-
is false, because make-string makes a new string, which is not eq? to any other string (or any other object), since it is new.
So string->symbol is the thing you would call if you were implementing a language at the point where you had a sequence of characters which you wanted to name a symbol.
symbol->string is how you get the name of a symbol: it's what you'd call if you wanted to print it. It's typically not defined (and I think actually not defined) whether
(let ((s (string->symbol "s"))) (eq? (symbol->string s) (symbol->string s)))-
is true or false: it may be that symbol->string returns the string that actually is the name of the symbol, or it may return a copy of it (and there's no requirement for the 'string which actually is the name' to actually exist anywhere: for instance the table where symbols live could be a trie which does not store the strings which name them anywhere.
It will be the case that
(let ((s (string->symbol "s"))) (string=? (symbol->string s) (symbol->string s)))-
is true however.
So to answer your question: yes, a symbol and its name are different concepts, and the difference is this notion of identity: if you have two symbols you can know if they are in fact the same symbol by comparing them with eq?, while if you have two names (strings) you need to compare them element-wise.
I think that this is as far as Scheme goes (at least it's as far as R5RS & R6RS go I think). However there are two generalisations to this notion of symbol which are important.
Uninterned symbols. Above I've described symbols as being interned in some kind of table whose keys are the strings which name symbols. But there's another possibility: you could create a symbol, but then stop before actually interning it in the table. The result is a symbol which has a name but that name is unutterable. An uninterned symbol breaks the equivalence between names and symbols. In particular, for interned symbols it is always the case that, if (string=? (symbol->string x) (symbol->string y)) then (eq? x y), but this is not true if one or both x or y are not interned.
This sounds like a useless thing to be able to do, but it's not.
A program may want to create a symbol which it is absolutely certain does not already exist. If there were only interned symbols then it has to do this by creating a new name, each time, and then checking that no symbol with that name exists. The two procedures I've described above aren't enough to do even this, because once you've called string->symbol then the symbol does exist: you'd need an additional string-names-symbol? predicate which checked if a symbol named by its argument existed but did not create it if it did not (and then in a multithreaded implementation you would need some atomicity around everything which would make things even more complicated).
Well, one solution to that is just to create an uninterned symbol: this is a symbol which you can be absolutely certain does not already exist, because its name is unutterable.
But, well, why would a program want a symbol which it is absolutely sure does not already exist? The traditional answer to this is macros: programs which write programs. Let's say you are writing some macro which is at some point going to want to create some code like this:
(let ((my-variable ...)) ... do something with my-variable ... ... some code I don't control is in here ... ... do something else with my-variable ...)-
Well, there's a problem here: what if the code you don't control includes the use of a variable named my-variable: oops. But if I arrange life so that the variable I bind is a brand new symbol with an unutterable name, then I know that the code I don't control can't talk about it, simply because it can't ever utter its name to get hold of it. Well, that's what uninterned symbols do.
Here is an example CL macro which uses this trick:
(defmacro p1 (form &body forms) (let ((stashn (make-symbol "STASH"))) `(let ((,stashn ,form)) ,@forms ,stashn)))-
This uses the CL make-symbol function to make a new, uninterned symbol, and then uses it to capture the value of the first subform, before evaluating the remaining subforms & then returning the value it stashed.
A form like this
(p1 1 2 3)-
Expands to this
(let ((#:stash 1)) 2 3 #:stash)-
Where #: is the notation CL uses for uninterned symbols. Note that CL can create uninterned symbols in the reader using this notation, but, for instance
> (eq '#:foo '#:foo)nil-
However the two symbols in the macroexpansion above are in fact the same symbol, and you can persuade the printer to show you they are:
> (let ((*print-circle* t)) (pprint (macroexpand '(p1 1 2 3))))-(let ((#1=#:stash 1)) 2 3 #1#)-
The #1= & #1# notation tells you that the two things are the same thing. And yes, you can use this at read-time too:
> (eq '#1=#:foo '#1#)t-
Scheme has adopted a different approach to solving this problem (and this is probably why R5RS & R6RS don't provide facilities to deal with uninterned symbols), but this approach is how you deal with it in Lisps like Common Lisp, for instance.
(Note that uninterned symbols give the lie to my claim that a symbol doesn't need to know its name: uninterned symbols really do (although I could imagine an implementation where uninterned symbols simply had no name, so, well, I don't know).)
Richer symbols. Once you have symbols you can hang all sorts of things from them, and this has traditionally been done. For instance, symbols in Common Lisp are conceptually very rich objects, having:
- variable values via symbol-value (this is distinct from their use to name lexically-bound variables in code);
- function-values via symbol-function;
- property lists via symbol-plist;
- and also being used to name things like classes and so on.
CL also makes the tables where symbols get interned first-class objects – packages – so you can do a lot of introspection about what symbols exist and so on.
One way to think about doing things like this is that symbols become big objects: symbols actually have slots for the various things that belong to them. But this does not have to be the case: here is a bit of Racket code which gives symbols an additional funge slot:
#lang racket-(define funges (make-hasheq))-(define (symbol-funge? s) (hash-has-key? funges s))-(define (symbol-funge s (default (thunk (error "no funge")))) (hash-ref funges s default))-(define (set-symbol-funge! s v) (hash-set! funges s v))-(define (remove-symbol-funge! s) (hash-remove! funges s))-
So, even in CL, all the additional 'slots' in symbols don't actually need to exist in the symbols themselves.
Note: languages which want to talk about languages, and have symbols to help them do so may or may not use the same mechanisms to talk about themselves as to talk about other languages that are being built in the language. Traditionally Lisps used symbols explicitly in their own implementations a lot, but that is less the case now than it was.
Scheme, I think, needs no use of symbols in its own description at all other than as objects which are implemented in the language: the specification talks about 'identifiers' (see the comment to this article by Chris Vine), and the macro system does not rely on symbols.
CL is much more traditional and symbols play a bigger role in the description of the language. In particular CL's macro system explicitly involves manipulating the source of programs represented as structures involving symbols which name things: this is why CL needs uninterned symbols to create unique names.
However even in the CL case symbols can fade into the background in the implementation. Consider this CL function definition:
(defun sum-tree (tree) (labels ((summit (branch sum) (etypecase branch (null sum) (number (+ sum branch)) (cons (summit (car branch) (summit (cdr branch) sum)))))) (summit tree 0)))-
If I type this interactively at a fresh CL REPL (in a package which only uses the CL package) then five new symbols will be created: sum-tree, tree, summit, branch, & sum, and one of those symbols, sum-tree will name a function, so (fboundp sum-tree) will be true and (fdefinition 'sum-tree) will return a function.
If I then compile this definition with (compile 'sum-tree), those symbols will still all exist.
But if I put this definition in a file and (each time in a fresh CL):
- compile & load the file with (compile-file ... :load t);
- or compile the file with (compile-file ...), start a new CL and then load the file with (load ...).
Then what symbols are created? In each case sum-tree is created and bound to a function, but it's not at all clear what other symbols are created. In the days of comp.lang.lisp I'm sure people had heated arguments about what compile-file needs to do: is it required to use read (yes I think it is) and if so is it allowed to unwind side-effects of read and if so which ones? Can it unintern symbols that read interned? In the final case where the compile file is loaded in a completely fresh instance I think it's very clear that the only symbol that needs to be created is sum-tree.
Similarly in CL, unlike in some very old implementations, it's not the case that in a form like
(let ((x ...)) ...)-
I can, in the body, expect to use some introspection on the symbol x at run-time to find what value it is bound to (it may be possible at macro-expansion time to work out which symbols will be bound at runtime, although it it not portably so in CL).
1/5
Top Answer
Answered Aug 13, 2011 · 404 votes
UTF-8 is a multibyte encoding that can represent any Unicode character. ISO 8859-1 is a single-byte encoding that can represent the first 256 Unicode characters. Both encode ASCII exactly the same way.
Other Answers
Answered Aug 13, 2011 · 162 votes
Wikipedia explains both reasonably well: UTF-8 vs Latin-1 (ISO-8859-1). Former is a variable-length encoding, latter single-byte fixed length encoding. Latin-1 encodes just the first 256 code points of the Unicode character set, whereas UTF-8 can be used to encode all code points. At physical encoding level, only codepoints 0 - 127 get encoded identically; code points 128 - 255 differ by becoming 2-byte sequence with UTF-8 whereas they are single bytes with Latin-1.
Other Answers
Answered Jan 25, 2022 · 122 votes
UTF
UTF is a family of multi-byte encoding schemes that can represent Unicode code points which can be representative of up to 2^31 [roughly 2 billion] characters. UTF-8 is a flexible encoding system that uses between 1 and 4 bytes to represent the first 2^21 [roughly 2 million] code points.
Long story short: any character with a code point/ordinal representation below 127, aka 7-bit-safe ASCII is represented by the same 1-byte sequence as most other single-byte encodings. Any character with a code point above 127 is represented by a sequence of two or more bytes, with the particulars of the encoding best explained here.
ISO-8859
ISO-8859 is a family of single-byte encoding schemes used to represent alphabets that can be represented within the range of 127 to 255. These various alphabets are defined as "parts" in the format ISO-8859-n, the most familiar of these likely being ISO-8859-1 aka 'Latin-1'. As with UTF-8, 7-bit-safe ASCII remains unaffected regardless of the encoding family used.
The drawback to this encoding scheme is its inability to accommodate languages comprised of more than 128 symbols, or to safely display more than one family of symbols at one time. As well, ISO-8859 encodings have fallen out of favor with the rise of UTF. The ISO "Working Group" in charge of it having disbanded in 2004, leaving maintenance up to its parent subcommittee.
Windows Code Pages
It's worth mentioning that Microsoft also maintains a set of character encodings with limited compatibility with ISO-8859, usually denoted as "cp####". MS seems to have a push to move their recent product releases to using Unicode in one form or another, but for legacy and/or interoperability reasons you're still likely to run into them.
For example, cp1252 is a superset of the ISO-8859-1, containing additional printable characters in the 0x80-0x9F range, notably the Euro symbol € and the much maligned "smart quotes" “”. This frequently leads to a mismatch where 8859-1 can be displayed as 1252 perfectly fine, and 1252 may seem to display fine as 8859-1, but will misbehave when one of those extra symbols shows up.
Aside from cp1252, the Turkish cp1254 is a similar superset of ISO-8859-9, but all other Windows Code Pages have at least some fundamental conflicts, if not differing entirely from their 8859 equivalent.
2/5
Top Answer
Answered May 10, 2023 · 1 votes
The page https://archlinux.org/packages/community/x86_64/code/ says
Description: The Open Source build of Visual Studio Code (vscode) editor Upstream URL: https://github.com/microsoft/vscode
which reads pretty clearly to me that it's a build of VS Code. You can find the instructions for building and running VS Code at https://github.com/microsoft/vscode/wiki/How-to-Contribute.
See also this comment from @chrisdias (a member of the VS Code team), which they wrote:
The cool thing about all of this is that you have the choice to use the Visual Studio Code branded product under our license or you can build a version of the tool straight from the vscode repository, under the MIT license.
Here's how it works. When you build from the vscode repository, you can configure the resulting tool by customizing the product.json
file. This file controls things like the Gallery endpoints, “Send-a-Smile” endpoints, telemetry endpoints, logos, names, and more.
When we build Visual Studio Code, we do exactly this. We clone the vscode repository, we lay down a customized product.json that has Microsoft specific functionality (telemetry, gallery, logo, etc.), and then produce a build that we release under our license.
When you clone and build from the vscode repo, none of these endpoints are configured in the default product.json. Therefore, you generate a "clean" build, without the Microsoft customizations, which is by default licensed under the MIT license (note, i made this commit to help make this more clear).
That's probably something along the lines of you're looking at in this Arch package: a build of VS Code, and is what VSCodium is.
The difference is what product.json they use for the build. If you click the "Source Files" link in the right sidebar of the page you linked, you'll see a file called product_json.diff, which just looks to me like a patch on top of the default product.json.
Also, I'm not surprised that you're seeing a package manager use "code" as an alias for VS Code. on the Snap store, VS Code is registered as "code". https://snapcraft.io/code.
3/5
Top Answer
Answered Sep 17, 2014 · 7 votes
There doesn't seem to be a difference, from the documentation:
The alias keyword is most frequently used to alias methods. When aliasing a method you can use either its name or a symbol:
alias new_name old_namealias :new_name :old_name-
4/5
Top Answer
Answered Dec 28, 2009 · 12 votes
"System environments" means things like Linux, Windows x86, Windows x64, etc. Notice how they use the term "architecture" interchangeably at the end of the paragraph.
A native C++ program is one where you take standard (ANSI/ISO) C++ and you compile it into a .exe. Usually you will be compiling this for a specific environment, e.g. Windows x86, in which case it could not run under Linux and would run under the WoW64 emulation layer on Windows x64. Notably, this code runs directly on the machine.
C++/CLI is a different programming language than standard C++. It, just like C# or VB.NET, runs on top of Microsoft's Common Language Interface. This means it has access to all those nice things in the paragraph you quoted, like the base class library and compilation to IL which allows it to be run on different architectures. But, just like C# and VB.NET, it does not run natively on the machine. It requires the installation of the .NET Framework; part of the .NET Framework's job is translating C++/CLI programs into native programs, which means they have much less direct access to the machine.
5/5
People also ask
What is ISO 4217?
- ISO 4217 is a standard published by the International Organization for Standardization (ISO) that defines alpha codes and numeric codes for the representation of currencies and provides information about the relationships between individual currencies and their minor units. This data is published in three tables:
ISO 4217 - Wikipedia
en.wikipedia.org/wiki/ISO_4217What is ISO 4217 alphabetic code?
- The alphabetic code is based on another ISO standard, ISO 3166, which lists the codes for country names. The first two letters of the ISO 4217 three-letter code are the same as the code for the country name, and, where possible, the third letter corresponds to the first letter of the currency name. ^ "ISO 4217 Amendment Number 94" (PDF).
ISO 4217 - Wikipedia
en.wikipedia.org/wiki/ISO_4217Why does SLS conflict with ISO 4217?
- SLS conflicts with ISO 4217, because SL stands for Sierra Leone. STG stands for STerlinG, the official name of the United Kingdom's currency, of which the pound is the main unit. While not an ISO code, "STG" is nonetheless the CHAPS real-time gross settlement and clearing code for sterling recognized by SWIFT.
ISO 4217 - Wikipedia
en.wikipedia.org/wiki/ISO_4217Why does Transnistria conflict with ISO 4217?
- Transnistria is an unrecognised state and is de facto rather than de jure independent. PRB conflicts with ISO 4217, because PR stands for Puerto Rico. Somaliland is an unrecognised state and is de facto rather than de jure independent. SLS conflicts with ISO 4217, because SL stands for Sierra Leone.
ISO 4217 - Wikipedia
en.wikipedia.org/wiki/ISO_4217en.wikipedia.org › wiki › ISO_4217ISO 4217 - Wikipedia
en.wikipedia.org › wiki › ISO_42172 days ago · ISO 4217 is a standard published by the International Organization for Standardization (ISO) that defines alpha codes and numeric codes for the representation of currencies and provides information about the relationships between individual currencies and their minor units.
stackoverflow.com › questions › 78590925c# - Best format for money serialization .net - Stack Overflow
stackoverflow.com › questions › 7859092518 hours ago · We are looking for best format for money serialization money in .net. We use NodaMoney. Which supports ISO-4217 and System.Text.Json serialization. We implemented serializer public class
en.wikipedia.org › wiki › Venezuelan_bolívarVenezuelan bolívar - Wikipedia
en.wikipedia.org › wiki › Venezuelan_bolívarMay 30, 2024 · The currency has the ISO 4217 currency code "VED". Currency black market [ edit ] The value of one US dollar in Venezuelan hard bolívares (before 20 August 2018) and sovereign bolívares on the parallel (or black) market through time.
en.wikipedia.org › wiki › Mexican_pesoMexican peso - Wikipedia
en.wikipedia.org › wiki › Mexican_peso2 days ago · The Mexican peso (symbol: $; code: MXN) is the currency of Mexico. Modern peso and dollar currencies have a common origin in the 16th–19th century Spanish dollar, most continuing to use its sign, "$". The current ISO 4217 code for the peso is MXN; the "N" refers to the "new peso". Prior to the 1993 revaluation, the code MXP was used.
www.ncesc.com › geographic-faq › what-is-theWhat is the currency and flag of Venezuela ... - NCESC
www.ncesc.com › geographic-faq › what-is-theMay 11, 2024 · The currency of Venezuela is the Venezuelan Bolívar (VEB), and the flag of Venezuela is a horizontal tricolor of yellow, blue, and red with the National Coat of Arms on the upper hoist-side of the yellow band and an arc of eight white five-pointed stars centered on the blue band. What currency did Venezuela use before the bolivar fuente?
- Carlos Sanford
www.dnbcgroup.com › currency-converterCurrency converter - DNBC Financial Group®
www.dnbcgroup.com › currency-converter4 days ago · DNBC has a complete list of ISO 4217 Currency Codes, which shows the standard three-letter codes for every currency in the world.
www.ato.gov.au › businesses-and-organisationsGuide to functional currency rules | Australian Taxation Office
www.ato.gov.au › businesses-and-organisationsMay 30, 2024 · ... Guide to functional currency rules. Information about functional currency rules, eligibility and the implications for tax accounting and reporting. Last updated 30 May 2024. Print or Download. On this page. How to use this guide. Functional currency translation rules. How the functional currency rules work.
Searches related to what is the difference between currency symbol and iso 4217 code