Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Wat dat variable mean?

Name: Anonymous 2011-10-27 13:16

So, reading the trying the LTU imperative/declarative papers made me think.

A function and a function call can seen as a renaming and environment building operation. Are there any other not-as-mainstream ways to perform the same thing?

A piece of code is executed in an environment where variables have meaning attached to them. How do those variables get a meaning?
[list][li]Locally introduced variables. Intermediate values are given a name, or perhaps a local function is defined, which needs to refer to local variables.[/li][li]Function parameters. A general piece of code is run for some arbitrary parameter values.[/li][li]A global name in C for instance - the program linker finds a function/value with the given name in some object file and places a reference to it where ever it's used.[/li][li]A closure is made which is able to refer to variables in the environment it was created in.[/li][li]A class defines an environment for a set of methods. The environment is passed as one parameter to the metods.[/li][li][tt]set[/tt] in lisp, which gives a new value to a symbol passed as a parameter.[/li][/list]In a way, all of the examples above are different ways of linking. Only one of them is performed at compile time, the others are done at run-time.

Are there other ways to extend/manipulate the environment found in programming languages? Can you think of any other way that is might not be feasible to implemenmt in a programming language?

Name: Anonymous 2011-10-27 14:11

Reformatting it for you: (Also read http://dis.4chan.org/read/prog/1239106894/1)

So, reading the trying the LTU imperative/declarative papers made me think.

A function and a function call can seen as a renaming and environment building operation. Are there any other not-as-mainstream ways to perform the same thing?

A piece of code is executed in an environment where variables have meaning attached to them. How do those variables get a meaning?
* Locally introduced variables. Intermediate values are given a name, or perhaps a local function is defined, which needs to refer to local variables.
* Function parameters. A general piece of code is run for some arbitrary parameter values.
* A global name in C for instance - the program linker finds a function/value with the given name in some object file and places a reference to it where ever it's used.
* A closure is made which is able to refer to variables in the environment it was created in.
* A class defines an environment for a set of methods. The environment is passed as one parameter to the metods.
* set in lisp, which gives a new value to a symbol passed as a parameter.

In a way, all of the examples above are different ways of linking. Only one of them is performed at compile time, the others are done at run-time.

Are there other ways to extend/manipulate the environment found in programming languages? Can you think of any other way that is might not be feasible to implemenmt in a programming language?

Name: Anonymous 2011-10-27 14:13


<metacircularns:begin-construct-env metacircularns:name = 'my_closure' />
<metacircularns:add-binding metacircularns:name='x'>
   <metacircularns:expression>
        <metacircularns:get-attribute metacircularns:name='field' />
        <metacircularns:operator metacircularns:name='multiplication' />
        <metacircularns:const metacircularns:type='integer' metacircularns:name='2' />
   </metacircularns:expression>
</metacircularns:add-binding>
<metacircularns:end-construct-env />

Name: Anonymous 2011-10-27 14:18

>>2
U+2022 BULLET

Name: Anonymous 2011-10-27 14:21

Also,
Are there other ways to extend/manipulate the environment found in programming languages? Can you think of any other way that is might not be feasible to implemenmt in a programming language?
Check out first-class environments. I think Kernel's got them.

Name: Anonymous 2011-10-27 16:11

>>4
If you're going to use Unicode, I recommend the much more snazzy U+2023 TRIANGULAR BULLET.

Name: Anonymous 2011-10-27 16:19

>>3
sorry i can't read java

Name: Anonymous 2011-10-27 20:53

>>3
Looks like <midichlorians>

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List