commit
d7e680331c
1 changed files with 5 additions and 7 deletions
12
doc/tut2.txt
12
doc/tut2.txt
|
|
@ -233,17 +233,15 @@ is needed:
|
||||||
|
|
||||||
type
|
type
|
||||||
Socket* = ref object of RootObj
|
Socket* = ref object of RootObj
|
||||||
FHost: int # cannot be accessed from the outside of the module
|
host: int # cannot be accessed from the outside of the module due to missing star
|
||||||
# the `F` prefix is a convention to avoid clashes since
|
|
||||||
# the accessors are named `host`
|
|
||||||
|
|
||||||
proc `host=`*(s: var Socket, value: int) {.inline.} =
|
proc `host=`*(s: var Socket, value: int) {.inline.} =
|
||||||
## setter of hostAddr
|
## setter of host address
|
||||||
s.FHost = value
|
s.host = value
|
||||||
|
|
||||||
proc host*(s: Socket): int {.inline.} =
|
proc host*(s: Socket): int {.inline.} =
|
||||||
## getter of hostAddr
|
## getter of host address
|
||||||
s.FHost
|
s.host
|
||||||
|
|
||||||
var s: Socket
|
var s: Socket
|
||||||
new s
|
new s
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue