Metaprogramming
Concepts of Programming Languages Alexander Schramm
Institut für Softwaretechnik und Programmiersprachen
- 2. November 2015
- A. Schramm
- 2. November 2015
1/39
Metaprogramming Concepts of Programming Languages Alexander Schramm - - PowerPoint PPT Presentation
Metaprogramming Concepts of Programming Languages Alexander Schramm Institut fr Softwaretechnik und Programmiersprachen 2. November 2015 A. Schramm 2. November 2015 1/39 Table of Contents Introduction Runtime Reflection in Java Runtime
1/39
2/39
3/39
4/39
5/39
6/39
7/39
8/39
◮ What is its class ◮ Which methods does it respond to
9/39
10/39
11/39
12/39
13/39
14/39
15/39
◮ A class object has the class Class ◮ Class methods live in the singleton/eigenclass of the class object
15/39
16/39
17/39
18/39
19/39
20/39
21/39
22/39
23/39
24/39
25/39
◮ int max(int a, int b)
25/39
◮ int max(int a, int b)
25/39
◮ int max(int a, int b)
◮ string max(string a, string b)
25/39
◮ int max(int a, int b)
◮ string max(string a, string b)
25/39
◮ int max(int a, int b)
◮ string max(string a, string b)
◮ No such function Error
25/39
26/39
◮ Vector template as array of the type ◮ But not for booleans, because of space (16-32 bit)
27/39
28/39
29/39
֒ →
30/39
31/39
32/39
33/39
◮ Allow evaluation with ~(+ 2 3)
◮ Generate unevaluated lists with '(a b c) ◮ Unevaluated list except macros `(a b c)
34/39
35/39
36/39
37/39
38/39
39/39