SlideShare a Scribd company logo
reflect&package
@takufukushima
What%is%"reflec&on"?
Reflec%on(in(compu%ng(is(the(ability(of(a(program(to(
examine(its(own(structure,(par%cularly(through(types;(
it's(a(form(of(metaprogramming.(It's(also(a(great(
source(of(confusion.
—"h$p://blog.golang.org/laws2of2reflec7on
Agenda
• Inside(of(Interfaces
• The(Laws(of(Reflec5on
• reflect(Package
Inside'of'Interfaces
Types&and&interfaces:&Types
type MyInt int
var i int
var j MyInt
// You can't assign j to i without conversion.
i = j // ERROR!
Types&and&interfaces:&Interfaces
// io.Reader is the interface that wraps the
// basic Read method.
type Reader interface {
Read(p []byte) (n int, err error)
}
var r io.Reader
r = os.Stdin
r = bufio.NewReader(r)
r = new(bytes.Buffer)
Interfaces*are*sta+cally*checked
interface {}
Go's%interfaces—sta/c,%checked%at%compile%/me,%
dynamic%when%asked%for—are,%for%me,%the%most%
exci/ng%part%of%Go%from%a%language%design%point%of%
view.%If%I%could%export%one%feature%of%Go%into%other%
languages,%it%would%be%interfaces.
—"Russ"Cox,"Go"Data"Structures:"Interfaces
h"p://research.swtch.com/interfaces
Example:)Stringer)interface
type Stringer interface {
String() string
}
func ToString(any interface{}) string {
if v, ok := any.(Stringer); ok {
return v.String()
}
switch v := any.(type) {
case int:
return strconv.Itoa(v)
case float:
return strconv.Ftoa(v, 'g', -1)
}
return "???"
}
Example:)Binary)has)String)
method
type Binary uint64
// Binary implements Stringer interface
func (i Binary) String() string {
return strconv.Uitob64(i.Get(), 2)
}
func (i Binary) Get() uint64 {
return uint64(i)
}
itable:"an"interface"table
b := Binary(200)
Behind'the'scene'of'the'method'
invoca0on
b := Binary(200)
s := Stringer(b)
// var s Stringer = b makes a copy of b
var c uint64 = b // This makes a copy of b
s.String() // tab->fun[0](s.data) in C
Compu&ng)the)itable
Precompu)ng,all,possible,itables,costs,a,lot.,So,
they're,computed,at,run)me.,See,go/src/pkg/
runtime/iface.goc.
• The%compiler%generates%a%type%descrip4on%
structure%for%each%concreate%type
• The%compiler%generates%a%(different)%type%
descrip4on%structure%for%each%interface%type
• The%interface%run4me%computes%the%itable%looking%
for%each%method%tables
Op#miza#on*of*compu#ng*the*itable
• Cache'the'itable
• Sort'two'method'tables'(for'the'concrete'types'and'
interface'types)'and'walking'them'simultaneously
• From'O(ni%*%nt)'to'O(ni%+%nt)
Memory'Op*miza*on:'Empty'interface
Memory'Op*miza*on:'Small'enough'value
Memory'Op*miza*on:'Combina*on'of'the'two'
cases
Method'Loookup'Performance
• In$Smalltalk+ish$way,$the$method$lookup$happens$
every$9me$with$maybe$caching
• In$Go,$a>er$the$computa9on$of$itable$it$is$a$couple$
of$memory$fetches$and$a$single$indirect$call$
instruc9on
var any interface{} // initialized elsewhere
s := any.(Stringer) // dynamic conversion
for i := 0; i < 100; i++ {
fmt.Println(s.String())
}
The$Laws$of$Reflec.on
The$Laws$of$Reflec.on$by$Rob$Pike
h"p://blog.golang.org/laws0of0reflec5onn
1. Reflec'on*goes*from*interface*value*to*reflec'on*
object
2. Reflec'on*goes*from*reflec'on*object*to*interface*
value
3. To*modify*a*reflec'on*object,*the*value*must*be*
se?able
1.#Reflec(on#goes#from#interface#
value#to#reflec(on#object
var x float64 = 3.4
v := reflect.ValueOf(x)
fmt.Println("type:", v.Type())
fmt.Println("kind is float64:", v.Kind() == reflect.Float64)
fmt.Println("value:", v.Float())
pritns
type: float64
kind is float64: true
value: 3.4
Type!and!Kind
var x uint8 = 'x'
v := reflect.ValueOf(x)
fmt.Println("type:", v.Type()) // uint8.
fmt.Println("kind is uint8: ",
v.Kind() == reflect.Uint8) // true.
x = uint8(v.Uint()) // v.Uint returns a uint64.
type MyInt int
var x MyInt = 7
v := reflect.ValueOf(x)
fmt.Println("kind is Int: ", v.Kind() == reflect.Int) // true.
2.#Reflec(on#goes#from#reflec(on#
object#to#interface#value
// Interface returns v's value as an interface{}.
// func (v Value) Interface() interface{}
y := v.Interface().(float64) // y will have type float64
fmt.Println(y)
fmt.Printf("value is %7.1en", v.Interface()) // 3.4e+00
In#short,#the#Interface#method#is#the#inverse#of#the#
ValueOf#func6on,#except#that#its#result#is#always#of#
sta6c#type#interface{}.
Reitera6ng:#Reflec6on#goes#from#interface#values#to#
reflec6on#objects#and#back#again.
3.#To#modify#a#reflec0on#object,#the#
value#must#be#se;able
var x float64 = 3.4
v := reflect.ValueOf(x)
v.SetFloat(7.1) // Error: will panic.
// panic: reflect.Value.SetFloat using unaddressable value
var x float64 = 3.4
v := reflect.ValueOf(x)
fmt.Println("settability of v:", v.CanSet())
// settability of v: false
What%is%"se$ability"?
Se#ability*is*determined*by*whether*the*
reflec4on*object*holds*the*original*item.
var x float64 = 3.4
// We're passing the copy of x here.
v := reflect.ValueOf(x)
// Think about the difference between f(x) and f(&x).
// v.SetFloat(7.1) updates the copied value inside the
// reflection value.
So#then,#how#can#we#modify#the#reflec3on#value?
"Use%the%pointer,%Luke."
var x float64 = 3.4
p := reflect.ValueOf(&x) // Note: take the address of x.
fmt.Println("type of p:", p.Type())
// type of p: *float64
fmt.Println("settability of p:", p.CanSet())
// settability of p: false
v := p.Elem()
fmt.Println("settability of v:", v.CanSet())
// settability of v: true
v.SetFloat(7.1)
fmt.Println(v.Interface())
// 7.1
fmt.Println(x)
// 7.1
Modifying)Structs
type T struct {
A int // Only exported fields are settable.
B string
}
t := T{23, "skidoo"}
s := reflect.ValueOf(&t).Elem()
typeOfT := s.Type()
for i := 0; i < s.NumField(); i++ {
f := s.Field(i)
fmt.Printf("%d: %s %s = %vn", i,
typeOfT.Field(i).Name, f.Type(), f.Interface())
}
// "0: A int = 23" and "1: B string = skidoo"
s.Field(0).SetInt(77)
s.Field(1).SetString("Sunset Strip")
fmt.Println("t is now", t) // t is now {77 Sunset Strip}
Here$again$are$the$laws$of$reflec2on:
• Reflec&on)goes)from)interface)value)to)reflec&on)
object
• Reflec&on)goes)from)reflec&on)object)to)interface)
value
• To)modify)a)reflec&on)object,)the)value)must)be)
se<able
reflect!Package
Constants'and'u*lity'func*ons
const (
SelectSend // case Chan <- Send
SelectRecv // case <-Chan:
SelectDefault // default
)
func Copy(dst, src Value) int
// Recursive comparison; []T{} != nil
func DeepEqual(a1, a2 interface{}) bool
func Select(cases []SelectCase) (chosen int,
recv Value,
recvOK bool)
Kind
const (
Invalid Kind = iota
Bool
Int; Int8; Int16; Int32; Int64
Uint; Uint8; Uint16; Uint32; Uint64; Uintptr
Float32; Float64
Complex64; Complex128
Array
Chan
Func
Interface
Map
Ptr
Slice
String
Struct
UnsafePointer
)
Types
type ChanDir // A channel type's direction
func (d ChanDir) String() string
type Kind // The specific kind of type
func (k Kind) String() string
type Method // A single method
type SelectCase // A single select case
type SelectDir // The communication direction
type SliceHeader // A slice
type StringHeader // A string
type StructField // A single field in a struct
type StructTag // The tag in a struct field
func (tag StructTag) Get(key string) string
type Type // A Go type
type Value // A Go value
type ValueError // Error for Value
func (e *ValueError) Error() string
Type!related!func,ons
func ChanOf(dir ChanDir, t Type) Type
func MapOf(key, elem Type) Type
func PtrTo(t Type) Type
func SliceOf(t Type) Type
func TypeOf(i interface{}) Type
Type!interface
type Type interface {
Align() int
FieldAlign() int
Method(int) Method
MethodByName(string) (Method, bool)
NumMethod() int
Name() string
PkgPath() string
Size() uintptr
String() string
Kind() Kind
Implements(u Type) bool // Check if it implements Type u
AssignableTo(u Type) bool
ConvertibleTo(u Type) bool
...
Type!interface
...
Bits() int
ChanDir() ChanDir // for Chan
IsVariadic() bool // for ...argument
Elem() Type // for Array, Chan, Map, Ptr, or Slice
Field(i int) StructField // for Struct
FieldByIndex(index []int) StructField
FieldByName(name string) (StructField, bool)
FieldByNameFunc(match func(string) bool) (StructField, bool)
In(i int) Type // The i'th input of the function
Key() Type // for Map
Len() int // for Array
NumField() int // for Struct
NumIn() int // The number of the input of the function
NumOut() int // The number of the output of the function
Out(i int) Type // The i'th output of the function
}
Value!related!func,ons
func Append(s Value, x ...Value) Value
func AppendSlice(s, t Value) Value
func Indirect(v Value) Value
func MakeChan(typ Type, buffer int) Value
func MakeFunc(typ Type,
fn func(args []Value) (results []Value)) Value
func MakeMap(typ Type) Value
func MakeSlice(typ Type, len, cap int) Value
func New(typ Type) Value
func NewAt(typ Type, p unsafe.Pointer) Value
func ValueOf(i interface{}) Value
func Zero(typ Type) Value
Value!methods:!Type!and!kind
func (v Value) Addr() Value
func (v Value) Bool() bool
func (v Value) Bytes() []byte
func (v Value) Complex() complex128
func (v Value) Float() float64
func (v Value) Int() int64
func (v Value) Interface() (i interface{})
func (v Value) InterfaceData() [2]uintptr
func (v Value) Kind() Kind
func (v Value) Pointer() uintptr
func (v Value) Slice(i, j int) Value
func (v Value) Slice3(i, j, k int) Value
func (v Value) String() string
func (v Value) Type() Type
func (v Value) Uint() uint64
func (v Value) UnsafeAddr() uintptr
Value!methods:!Can_,!Is_!and!
Overflow_
func (v Value) CanAddr() bool
func (v Value) CanInterface() bool
func (v Value) CanSet() bool
func (v Value) IsNil() bool
func (v Value) IsValid() bool
func (v Value) OverflowComplex(x complex128) bool
func (v Value) OverflowFloat(x float64) bool
func (v Value) OverflowInt(x int64) bool
func (v Value) OverflowUint(x uint64) bool
Value!methods:!Array,!Slice!and!
Map
func (v Value) Index(i int) Value
func (v Value) Cap() int
func (v Value) Len() int
func (v Value) MapIndex(key Value) Value
func (v Value) MapKeys() []Value
Value!methods:!Channel
func (v Value) Recv() (x Value, ok bool)
func (v Value) Send(x Value)
func (v Value) TryRecv() (x Value, ok bool)
func (v Value) TrySend(x Value) bool
func (v Value) Close()
Value!methods:!Func.on!and!
method
func (v Value) Call(in []Value) []Value
func (v Value) CallSlice(in []Value) []Value
func (v Value) Method(i int) Value
func (v Value) MethodByName(name string) Value
func (v Value) NumMethod() int
Value!methods:!Field!of!struct
func (v Value) Field(i int) Value
func (v Value) FieldByIndex(index []int) Value
func (v Value) FieldByName(name string) Value
func (v Value) FieldByNameFunc(match func(string) bool) Value
func (v Value) NumField() int
Value!methods:!Se+ers
func (v Value) Set(x Value)
func (v Value) SetBool(x bool)
func (v Value) SetBytes(x []byte)
func (v Value) SetCap(n int)
func (v Value) SetComplex(x complex128)
func (v Value) SetFloat(x float64)
func (v Value) SetInt(x int64)
func (v Value) SetLen(n int)
func (v Value) SetMapIndex(key, val Value)
func (v Value) SetPointer(x unsafe.Pointer)
func (v Value) SetString(x string)
func (v Value) SetUint(x uint64)
Value!methods:!Value!
manipula0on
func (v Value) Convert(t Type) Value
func (v Value) Elem() Value
Example:)MakeFunc
...
func main() {
swap := func(in []reflect.Value) []reflect.Value {
return []reflect.Value{in[1], in[0]}
}
makeSwap := func(fptr interface{}) {
fn := reflect.ValueOf(fptr).Elem()
v := reflect.MakeFunc(fn.Type(), swap)
fn.Set(v)
}
var intSwap func(int, int) (int, int)
makeSwap(&intSwap)
fmt.Println(intSwap(0, 1))
var floatSwap func(float64, float64) (float64, float64)
makeSwap(&floatSwap)
fmt.Println(floatSwap(2.72, 3.14))
}
Example:)StructTag
package main
import (
"fmt"
"reflect"
)
func main() {
type S struct {
F string `species:"gopher" color:"blue"`
}
s := S{}
st := reflect.TypeOf(s)
field := st.Field(0)
fmt.Println(field.Tag.Get("color"), field.Tag.Get("species"))
}
Example:)go-martini/martini
// Run the http server. Listening on os.GetEnv("PORT") or
// 3000 by default.
func (m *Martini) Run() {
port := os.Getenv("PORT")
if port == "" {
port = "3000"
}
host := os.Getenv("HOST")
// Dependency injection here.
logger := m.Injector.Get(
reflect.TypeOf(m.logger)).Interface().(*log.Logger)
logger.Printf("listening on %s:%s (%s)n", host, port, Env)
logger.Fatalln(http.ListenAndServe(host+":"+port, m))
}
Example:)codegangsta/inject
Dependency(Injec+on((DI)(in(Go
type injector struct {
values map[reflect.Type]reflect.Value
parent Injector
}
// New returns a new Injector.
func New() Injector {
return &injector{
values: make(map[reflect.Type]reflect.Value),
}
}
Example:)codegangsta/inject
func (i *injector) Map(val interface{}) TypeMapper {
i.values[reflect.TypeOf(val)] = reflect.ValueOf(val)
return i
}
func (i *injector) MapTo(val interface{}, ifacePtr interface{}) TypeMapper {
i.values[InterfaceOf(ifacePtr)] = reflect.ValueOf(val)
return i
}
func (i *injector) Set(typ reflect.Type, val reflect.Value) TypeMapper {
i.values[typ] = val
return i
}
Example:)codegangsta/inject
func (i *injector) Get(t reflect.Type) reflect.Value {
val := i.values[t]
if val.IsValid() {
return val
}
if t.Kind() == reflect.Interface {
for k, v := range i.values {
if k.Implements(t) {
val = v
break
}
}
}
if !val.IsValid() && i.parent != nil {
val = i.parent.Get(t)
}
return val
}
Use$Negroni,$not$Mar/ni
Mar$ni'reflec$on'is'flawed;!"The!real!tradeoff!with!
reflec1on!is!one!of!complexity."
—"My"Thoughts"on"Mar/ni,"Code"Gangsta
h"p://blog.codegangsta.io/blog/2014/05/19/my;
thoughts;on;mar>ni/
Gin$is$also$an$alterna,ve.
The$end$of$slides.$Any$
ques1on?
References
• The%Go%Blog:%The%Laws%of%Reflec4on
• h6p://blog.golang.org/laws<of<reflec4on
• Go%Data%Structures
• Interfaces%h6p://research.swtch.com/interfaces
• Package%reflect
• h6p://golang.org/pkg/reflect/
• go<mar4ni/mar4ni
• h6ps://github.com/go<mar4ni/mar4ni
References
• codegangsta/inject
• h/ps://github.com/codegangsta/inject
• My8Thoughts8on8Mar;ni,8Code8Gangsta
• h/p://blog.codegangsta.io/blog/2014/05/19/
myFthoughtsFonFmar;ni/
• ginFgonic/gin
• h/ps://github.com/ginFgonic/gin

More Related Content

What's hot

[Apostila] programação arduíno brian w. evans
[Apostila] programação arduíno   brian w. evans[Apostila] programação arduíno   brian w. evans
[Apostila] programação arduíno brian w. evans
Web-Desegner
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScript
T11 Sessions
 
Workshop Swift
Workshop Swift Workshop Swift
Workshop Swift
Commit University
 
Qcon2011 functions rockpresentation_f_sharp
Qcon2011 functions rockpresentation_f_sharpQcon2011 functions rockpresentation_f_sharp
Qcon2011 functions rockpresentation_f_sharp
Michael Stal
 
How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1
Taisuke Oe
 
Static types on javascript?! Type checking approaches to ensure healthy appli...
Static types on javascript?! Type checking approaches to ensure healthy appli...Static types on javascript?! Type checking approaches to ensure healthy appli...
Static types on javascript?! Type checking approaches to ensure healthy appli...
Arthur Puthin
 
C operators
C operatorsC operators
C operators
srmohan06
 
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ..."Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
PVS-Studio
 
Slide
SlideSlide
PHP 7.0 new features (and new interpreter)
PHP 7.0 new features (and new interpreter)PHP 7.0 new features (and new interpreter)
PHP 7.0 new features (and new interpreter)
Andrea Telatin
 
TypeScript introduction to scalable javascript application
TypeScript introduction to scalable javascript applicationTypeScript introduction to scalable javascript application
TypeScript introduction to scalable javascript application
Andrea Paciolla
 
Synapseindia dot net development
Synapseindia dot net developmentSynapseindia dot net development
Synapseindia dot net development
Synapseindiappsdevelopment
 
Space Time Varying Color Palettes
Space Time Varying Color PalettesSpace Time Varying Color Palettes
Space Time Varying Color Palettes
Bo Zhou
 
Introduction to Swift 2
Introduction to Swift 2Introduction to Swift 2
Introduction to Swift 2
Joris Timmerman
 
Serialization Surrogates
Serialization SurrogatesSerialization Surrogates
Serialization Surrogates
Shashank Saraf
 
Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010
Michelangelo van Dam
 
Kotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrainsKotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrains
Jigar Gosar
 
Custom view
Custom viewCustom view
Custom view
SV.CO
 

What's hot (20)

[Apostila] programação arduíno brian w. evans
[Apostila] programação arduíno   brian w. evans[Apostila] programação arduíno   brian w. evans
[Apostila] programação arduíno brian w. evans
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScript
 
Workshop Swift
Workshop Swift Workshop Swift
Workshop Swift
 
Qcon2011 functions rockpresentation_f_sharp
Qcon2011 functions rockpresentation_f_sharpQcon2011 functions rockpresentation_f_sharp
Qcon2011 functions rockpresentation_f_sharp
 
How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1
 
06 ruby variables
06 ruby variables06 ruby variables
06 ruby variables
 
Static types on javascript?! Type checking approaches to ensure healthy appli...
Static types on javascript?! Type checking approaches to ensure healthy appli...Static types on javascript?! Type checking approaches to ensure healthy appli...
Static types on javascript?! Type checking approaches to ensure healthy appli...
 
C operators
C operatorsC operators
C operators
 
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ..."Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
 
Slide
SlideSlide
Slide
 
Csharp_Chap06
Csharp_Chap06Csharp_Chap06
Csharp_Chap06
 
PHP 7.0 new features (and new interpreter)
PHP 7.0 new features (and new interpreter)PHP 7.0 new features (and new interpreter)
PHP 7.0 new features (and new interpreter)
 
TypeScript introduction to scalable javascript application
TypeScript introduction to scalable javascript applicationTypeScript introduction to scalable javascript application
TypeScript introduction to scalable javascript application
 
Synapseindia dot net development
Synapseindia dot net developmentSynapseindia dot net development
Synapseindia dot net development
 
Space Time Varying Color Palettes
Space Time Varying Color PalettesSpace Time Varying Color Palettes
Space Time Varying Color Palettes
 
Introduction to Swift 2
Introduction to Swift 2Introduction to Swift 2
Introduction to Swift 2
 
Serialization Surrogates
Serialization SurrogatesSerialization Surrogates
Serialization Surrogates
 
Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010
 
Kotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrainsKotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrains
 
Custom view
Custom viewCustom view
Custom view
 

Similar to Gunosy.go#7 reflect

Reflection in Go
Reflection in GoReflection in Go
Reflection in Go
strikr .
 
The Swift Compiler and Standard Library
The Swift Compiler and Standard LibraryThe Swift Compiler and Standard Library
The Swift Compiler and Standard Library
Santosh Rajan
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptx
Guy Komari
 
An introduction to functional programming with Swift
An introduction to functional programming with SwiftAn introduction to functional programming with Swift
An introduction to functional programming with Swift
Fatih Nayebi, Ph.D.
 
C programming(part 3)
C programming(part 3)C programming(part 3)
C programming(part 3)
SURBHI SAROHA
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
KrishanPalSingh39
 
Go Workshop Day 1
Go Workshop Day 1Go Workshop Day 1
Go Workshop Day 1
Hiroaki Kamei
 
Chapter 13.1.3
Chapter 13.1.3Chapter 13.1.3
Chapter 13.1.3patcha535
 
Introduction to Input/Output Functions in C
Introduction to Input/Output Functions in CIntroduction to Input/Output Functions in C
Introduction to Input/Output Functions in C
Thesis Scientist Private Limited
 
Quick swift tour
Quick swift tourQuick swift tour
Quick swift tour
Kazunobu Tasaka
 
golang_refcard.pdf
golang_refcard.pdfgolang_refcard.pdf
golang_refcard.pdf
Spam92
 
A well-typed program never goes wrong
A well-typed program never goes wrongA well-typed program never goes wrong
A well-typed program never goes wrongJulien Wetterwald
 
Transpilers Gone Wild: Introducing Hydra
Transpilers Gone Wild: Introducing HydraTranspilers Gone Wild: Introducing Hydra
Transpilers Gone Wild: Introducing Hydra
Joshua Shinavier
 
Effective Modern C++
Effective Modern C++Effective Modern C++
Effective Modern C++
Wang Hsiangkai
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’eShikshak
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
javaTpoint s
 

Similar to Gunosy.go#7 reflect (20)

Reflection in Go
Reflection in GoReflection in Go
Reflection in Go
 
The Swift Compiler and Standard Library
The Swift Compiler and Standard LibraryThe Swift Compiler and Standard Library
The Swift Compiler and Standard Library
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptx
 
Input And Output
 Input And Output Input And Output
Input And Output
 
An introduction to functional programming with Swift
An introduction to functional programming with SwiftAn introduction to functional programming with Swift
An introduction to functional programming with Swift
 
C programming(part 3)
C programming(part 3)C programming(part 3)
C programming(part 3)
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
 
Unit2 C
Unit2 CUnit2 C
Unit2 C
 
Unit2 C
Unit2 C Unit2 C
Unit2 C
 
Go Workshop Day 1
Go Workshop Day 1Go Workshop Day 1
Go Workshop Day 1
 
Chapter 13.1.3
Chapter 13.1.3Chapter 13.1.3
Chapter 13.1.3
 
Introduction to Input/Output Functions in C
Introduction to Input/Output Functions in CIntroduction to Input/Output Functions in C
Introduction to Input/Output Functions in C
 
Quick swift tour
Quick swift tourQuick swift tour
Quick swift tour
 
golang_refcard.pdf
golang_refcard.pdfgolang_refcard.pdf
golang_refcard.pdf
 
A well-typed program never goes wrong
A well-typed program never goes wrongA well-typed program never goes wrong
A well-typed program never goes wrong
 
Transpilers Gone Wild: Introducing Hydra
Transpilers Gone Wild: Introducing HydraTranspilers Gone Wild: Introducing Hydra
Transpilers Gone Wild: Introducing Hydra
 
Effective Modern C++
Effective Modern C++Effective Modern C++
Effective Modern C++
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 

More from Taku Fukushima

Container Orchestration Integration: OpenStack Kuryr
Container Orchestration Integration: OpenStack KuryrContainer Orchestration Integration: OpenStack Kuryr
Container Orchestration Integration: OpenStack Kuryr
Taku Fukushima
 
rtnetlink
rtnetlinkrtnetlink
rtnetlink
Taku Fukushima
 
Introduction to MidoNet
Introduction to MidoNetIntroduction to MidoNet
Introduction to MidoNet
Taku Fukushima
 
MidoNet deep dive
MidoNet deep diveMidoNet deep dive
MidoNet deep dive
Taku Fukushima
 
Om (Cont.)
Om (Cont.)Om (Cont.)
Om (Cont.)
Taku Fukushima
 
Om
OmOm
Gunosy.go #4 go
Gunosy.go #4 goGunosy.go #4 go
Gunosy.go #4 go
Taku Fukushima
 

More from Taku Fukushima (7)

Container Orchestration Integration: OpenStack Kuryr
Container Orchestration Integration: OpenStack KuryrContainer Orchestration Integration: OpenStack Kuryr
Container Orchestration Integration: OpenStack Kuryr
 
rtnetlink
rtnetlinkrtnetlink
rtnetlink
 
Introduction to MidoNet
Introduction to MidoNetIntroduction to MidoNet
Introduction to MidoNet
 
MidoNet deep dive
MidoNet deep diveMidoNet deep dive
MidoNet deep dive
 
Om (Cont.)
Om (Cont.)Om (Cont.)
Om (Cont.)
 
Om
OmOm
Om
 
Gunosy.go #4 go
Gunosy.go #4 goGunosy.go #4 go
Gunosy.go #4 go
 

Recently uploaded

space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 

Recently uploaded (20)

space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 

Gunosy.go#7 reflect