Names, again
Ah, names, they have fascinated people for ages (literally). In the past, some people believed that knowing the true name of something would give you power over it. In a sense, that is what we would like to have. We name our files, we name our resources, we name our objects. We name because we need to refer. So what are the ways that we can name something?
I am really confused about names. Maybe because I cant think well enough, but obviously names are first class things - you can have a name inside a file, you can have a list of names in a file, you can even have a database of names in a file. However, when we "dereference" a name, we get something that relates to the name. Interesting enough, a name->information (i.e. loading a file) is a function, since we would not like to have multiple information; while information->name (i.e. naming a file) is not a function, since the same information might be under many names.
For convention, we shall use N to be a name, which can be of any type (usually we think of it as a string like "this is a name.txt"). X shall be the information held in the name. Bold type is functions
I am really confused about names. Maybe because I cant think well enough, but obviously names are first class things - you can have a name inside a file, you can have a list of names in a file, you can even have a database of names in a file. However, when we "dereference" a name, we get something that relates to the name. Interesting enough, a name->information (i.e. loading a file) is a function, since we would not like to have multiple information; while information->name (i.e. naming a file) is not a function, since the same information might be under many names.
For convention, we shall use N to be a name, which can be of any type (usually we think of it as a string like "this is a name.txt"). X shall be the information held in the name. Bold type is functions
- Dictionary D: this is when we have a function that dereferences a name - i.e. takes a name and then returns the actual information. X = D N .
- Relational Dictionary R: this is when we relatively define a name N with respect to another name (the target T). So we get something like X = (R T) N .
An example is ownership - where we say something like "Jack's bank account". We get (R "Jack") is a function that takes a name and gives a dictionary function that will give you Jack's possessions. So (R "Jack") "Bank Account" is Jack's Bank Account information
This can be either seen as R being a curriable function or a second order function. Dunno anything about this type of stuff though (research research ^^). Interestingly enough, currying seems like a constraint on a function, rather than generating a new function.
We can also probably make a dictionary file, such that D N = (R d) N. This means something like a dictionary is just a relational dictionary applied on a dictionary file. Notice that our English vocabulary is just a dictionary, with an (arbitrary defined by the English speaking population) dictionary. - Constructive Approach: this is when we say how the information is constructed - i.e. as X = F Argument1 Argument2... . For example if we have original file name "Bank Account", and we added a cashflow of $10, we might represent this as: X = AddCashFlow "Bank Account" "+10". Obviously this is no different really, than a dictionary, except it can take many inputs, and it is not a dictionary lookup function. On a deeper level, this is really just a relational dictionary - we can envisage any function which takes many arguments a1 a2 a3... as X = ((((R a1) a2) a3) ... an). Darn, nothing new here.
However, this implies that we can structure the entire file system around a log of every function that has ever been applied (assuming the function is deterministic. If not, we might have to memoize the results - e.g downloading a file off the internet would have to be cached). Brain over load here. - Pure name: this is when N = X, and it is our target. So we have our original name X1, and we under go repetitive transformation and eventually get to a pure name, which is basically the information.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home