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

Pages: 1-4041-

Reflection

Name: Anonymous 2008-11-24 19:00

Can anyone explain in simple terms what the hell "Reflection" is supposed to be?

Professor was too lazy to teach properly.

Name: Anonymous 2008-11-24 19:06

ENTERPRISE self-modifying code

Name: Anonymous 2008-11-24 19:08

Reflection sends you to the weird and wonderful world behind the looking glass. Going the other way is called reification, making you real again.

Name: Anonymous 2008-11-24 21:01

Reflection is what LISP had since the very beginning.
It's when your program can have access to its own internal structures.

Name: Anonymous 2008-11-24 21:32

Rad SICP.

Name: Anonymous 2008-11-24 22:03

Reflect on your knowledge, young grasshopper, before you attempt to venture forth into reflection.

Name: Anonymous 2008-11-25 0:55

emax

Name: Anonymous 2008-11-25 2:16

The laws of physics aren't physical objects themselves; the type int is not an integer. Similarly, the rules and entities of a programming language that determine how programs work are not values in those programs. Reflection crosses that border by introducing objects that represent concepts from a higher level, providing a program with knowledge about the language it's in and itself. Examples: Reflection could let a program ask values for their types or for operations defined on them, or it could let a program manipulate its own symbol table.

Name: Anonymous 2008-11-25 2:22

>>8
What if you were building a debugger, or a code obfuscator?

Name: Anonymous 2008-11-25 8:05

Not OP - but, example of what reflection is used for?

Name: Anonymous 2008-11-25 8:42

Name: Anonymous 2008-11-25 13:50

>>10
In general, any run-time binding of code -- frex, to make a plug-in, where you inform your code of the new library, and it interrogates it for types that it is interested in (e.g. find all public concrete types implementing interface IMyPlugIn, which have default constructors), which your app can then use.

Name: Anonymous 2008-11-25 13:58

>>10

You could create a reusable component that takes any kind of object, iterates over all the properties of that object, and displays the name of the property and its value to the user.

At runtime the executing code doesn't care about what your objects property names are. It is of no use to the executing code. With reflection, at runtime you can get those names and the properties values by name.

Name: Anonymous 2008-11-25 16:05

>>13


    Go read the disassembly, you dumbass

Name: Anonymous 2008-11-25 16:19

>>14
The disassembly wouldn't have symbol names, unless the debug symbol table is present. But even so, it wouldn't be accessible from the program, not by direct means anyway.
HIBT?

Name: Anonymous 2008-11-25 23:04

>>3
reification
TEH REI

Name: Anonymous 2008-11-26 7:13

FUCK YOU

Name: Anonymous 2008-11-26 7:52

>>16
back to /b/, please

Name: Anonymous 2008-11-26 18:12

Um, to answer the OP's question in an over-simplified manner, it's when you can get the type of a variable as a string or something where the program itself can use it.  It's an ugly hack, you should only use it for debugging and use the polymorphic capabilities of your language instead.

Name: Anonymous 2008-11-26 19:17

The pleasure of being cummed inside

Name: Anonymous 2008-11-26 19:32

>>19 over-simplified manner
You should have stopped there. Variable types? What the fuck, man, what the fuck?

Name: Anonymous 2008-11-26 21:02

Reflection: You get what you ask for.

Name: Anonymous 2008-11-27 2:47

Reflection: when a monkey looks in a mirror, no philosopher looks out.

Name: Anonymous 2008-11-27 3:55

Reflection: the change in direction of a wavefront at an interface between two different media so that the wavefront returns into the medium from which it originated.

Name: Anonymous 2008-11-27 4:12

Reflection: what you see is what you've got.

Name: Anonymous 2008-11-27 4:30

>>21
Um, it's called RTTI.  Learn about it.  Thank you.

Name: Anonymous 2008-11-27 4:33

Reflection: Reflection

Name: Anonymous 2008-11-27 7:52

>>27
Valid recursive definition

Name: Anonymous 2008-11-27 13:43

Reflection : noitcelfeR

Name: Anonymous 2008-11-27 15:49

Reflection is serious thought or consideration : he doesn't get much time for reflection. An idea about something, esp. one that is written down or expressed.

In software, a program that can query its own structure.

   for (Method each : self.getClass().getMethods()) {
      System.out.println(each.getName());
   }

The ability to change its own structure at runtime is called HOT CODE SWAPPING.

    x := Class new.
    x superclass: Class.
    x methodDictionary: MethodDictionery new.
    x setFormat: Class format.
    x primitiveChangeClassTo: oroboros basicNew.
    [ x class = oroboros ] assert.

Name: Anonymous 2008-11-27 15:53

>>26
No, it's called "If type information were the sum total of reflection no one would want it."

Name: Anonymous 2008-11-27 17:06

>>29
lole

Name: Anonymous 2008-11-27 18:00

>>32
loeb

Name: Anonymous 2008-11-27 18:04

>>14

Wow you are an idiot. Learn from >>15

Name: Anonymous 2009-03-06 5:39

The Sussman Awesome b   The Ginger who   that kid who   did nothing great   c Leah Culver   she is terrible   at programming d   RMS how does   he break down   in tears and   run as fast   to compile besides.

Name: Anonymous 2009-03-06 15:39


Follower?

Name: Anonymous 2010-12-09 23:40

Name: Anonymous 2010-12-24 0:16

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