Permalink
Browse files

use ::= instead of newSlot()

::= is syntactic sugar for newSlot()
  • Loading branch information...
1 parent 09b3e3d commit 4f86987e763c7ab81004de44f0b057ba537edb88 Manfred Kroehnert committed Dec 27, 2008
Showing with 122 additions and 122 deletions.
  1. +3 −3 addons/AVCodec/samples/mp3filestream.io
  2. +3 −3 addons/AVCodec/samples/video.io
  3. +4 −4 addons/CFFI/io/Function.io
  4. +1 −1 addons/Curses/samples/browser.io
  5. +1 −1 addons/Curses/samples/docsbrowser.io
  6. +1 −1 addons/Flux/io/Flux/Views/ColumnView.io
  7. +1 −1 addons/Flux/samples/Debugger/menu.io
  8. +1 −1 addons/Flux/samples/Debugger/messageview.io
  9. +3 −3 addons/Flux/samples/Diagram/Background.io
  10. +1 −1 addons/Flux/samples/Diagram/DBox.io
  11. +1 −1 addons/Flux/samples/Diagram/LabelView.io
  12. +7 −7 addons/Flux/samples/Diagram/LineView.io
  13. +1 −1 addons/Flux/samples/Diagram/Selectable.io
  14. +4 −4 addons/Flux/samples/Self/main.io
  15. +2 −2 addons/Flux/samples/Slideshow/main.io
  16. +1 −1 addons/Flux/samples/SongJam/SJItem.io
  17. +1 −1 addons/Flux/samples/SongJam/Song.io
  18. +3 −3 addons/Flux/samples/SongJam/SongJamNode.io
  19. +2 −2 addons/Flux/samples/SongJam/TracksView.io
  20. +3 −3 addons/Font/samples/Terminal.io
  21. +2 −2 addons/Font/samples/slides.io
  22. +2 −2 addons/LZO/io/LZO.io
  23. +3 −3 addons/LibSndFile/samples/mp3filestream.io
  24. +1 −1 addons/Loki/tests/correctness/testcg.io
  25. +2 −2 addons/ODE/samples/extras/tutorial2.1.io
  26. +2 −2 addons/ODE/samples/extras/tutorial2.2.io
  27. +2 −2 addons/ODE/samples/tutorial2.io
  28. +5 −5 addons/ODE/samples/tutorial3.io
  29. +3 −3 addons/OpenGL/io/GLApp.io
  30. +3 −3 addons/OpenGL/io/ResourceManager.io
  31. +1 −1 addons/PortAudio/io/PortAudio.io
  32. +2 −2 addons/Rational/io/Rational.io
  33. +3 −3 addons/SampleRateConverter/samples/mp3filestream.io
  34. +2 −2 addons/SecureSocket/io/SecureServer.io
  35. +1 −1 addons/SecureSocket/io/SecureSocket.io
  36. +8 −8 addons/Socket/samples/IRC/CursesScreen.io
  37. +4 −4 addons/Socket/samples/IRC/IoBot.io
  38. +6 −6 addons/Socket/samples/MiniEmailServer.io
  39. +3 −3 addons/SoundTouch/samples/mp3filestream.io
  40. +8 −8 addons/SystemCall/io/SystemCall.io
  41. +2 −2 addons/Zlib/io/Zlib.io
  42. +1 −1 libs/iovm/io/UnitTest.io
  43. +7 −7 libs/iovm/io/Z_CLI.io
  44. +2 −2 samples/misc/ErlangChallenge.io
  45. +3 −3 samples/speed/speedResults.io
View
6 addons/AVCodec/samples/mp3filestream.io
@@ -7,9 +7,9 @@ AudioMixer := Object clone do(
self mixed := Sequence clone
)
- newSlot("streamDestination", AudioDevice)
- newSlot("processedSamples", 0)
- newSlot("isRunning", false)
+ streamDestination ::= AudioDevice
+ processedSamples ::= 0
+ isRunning ::= false
addSource := method(s, sources append(s))
removeSource := method(s, sources remove(s))
View
6 addons/AVCodec/samples/video.io
@@ -3,9 +3,9 @@
VideoDecoder := AVCodec clone do(
newSlot("internalCoro")
newSlot("externalCoro")
- newSlot("frameNumber", 0)
- newSlot("sampleRateConverter", nil)
- newSlot("audioOn", false)
+ frameNumber ::= 0
+ sampleRateConverter ::= nil
+ audioOn ::= false
isDone ::= false
init := method(
View
8 addons/CFFI/io/Function.io
@@ -4,8 +4,8 @@
*/
CFFI Function do(
- newSlot("library", Library)
- newSlot("name", "")
- newSlot("returnType", "")
- newSlot("argumentTypes", "")
+ library ::= Library
+ name ::= ""
+ returnType ::= ""
+ argumentTypes ::= ""
)
View
2 addons/Curses/samples/browser.io
@@ -10,7 +10,7 @@ Lobby exit := method(Curses end; System exit)
Inspector := Object clone do(
_object := Lobby
offset := 0
- newSlot("selectedSlotName", "")
+ selectedSlotName ::= ""
objectStack := List clone
objectSlotNames := method(object slotNames sort)
View
2 addons/Curses/samples/docsbrowser.io
@@ -15,7 +15,7 @@ Lobby exit := method(Curses end; System exit)
Outliner := Object clone do(
_object := Lobby
- newSlot("selectedSlotName", "")
+ selectedSlotName ::= ""
init := method(
resend
View
2 addons/Flux/io/Flux/Views/ColumnView.io
@@ -2,7 +2,7 @@
ColumnView := VScrollArea clone do(
textures := TextureGroup clone loadGroupNamed("ColumnView")
selectedItem := nil
- newSlot("delegate", nil)
+ delegate ::= nil
init := method(
resend
View
2 addons/Flux/samples/Debugger/menu.io
@@ -12,7 +12,7 @@ form := CGI parse
Page := Object clone do(
type := "Page"
- newSlot("folder", Directory clone)
+ folder ::= Directory clone
init := method(
resend
View
2 addons/Flux/samples/Debugger/messageview.io
@@ -148,7 +148,7 @@ MessageView := View clone do(
size set(Screen width, Screen height)
resizeWithSuperview
- newSlot("textColor", Point clone set(0,0,0,1))
+ textColor ::= Point clone set(0,0,0,1)
cursorImage := Image clone open("cursor.tif")
View
6 addons/Flux/samples/Diagram/Background.io
@@ -1,13 +1,13 @@
Background := View clone do(
- newSlot("gridSize", 10)
+ gridSize ::= 10
setBackgroundColor(Point clone set(.1, .1, .1, 1))
setOutlineColor(Point clone set(1, 1, 1, .03))
resizeWidthWithSuperview
resizeHeightWithSuperview
- newSlot("selectionArea", nil)
+ selectionArea ::= nil
- newSlot("lastBox", nil)
+ lastBox ::= nil
doubleLeftMouseDown := method(
box := DBox clone
View
2 addons/Flux/samples/Diagram/DBox.io
@@ -20,7 +20,7 @@ DBox := View clone do(
isBox := true
size set(140, 30)
- newSlot("selectedColor", Point clone set(.1, .8, .1, 1))
+ selectedColor ::= Point clone set(.1, .8, .1, 1)
setOutlineColor(Point clone set(.3, .3, .3, .95))
setBackgroundColor(Point clone set(.2, .2, .2, 1))
View
2 addons/Flux/samples/Diagram/LabelView.io
@@ -32,7 +32,7 @@ LabelView := TextField clone do(
font drawString(renderString)
)
- newSlot("isActive", false)
+ isActive ::= false
leftMouseDown := method(
if(isActive, resend, superview ?leftMouseDown)
View
14 addons/Flux/samples/Diagram/LineView.io
@@ -1,16 +1,16 @@
LineView := View clone do(
appendProto(Selectable)
- newSlot("origin", Point clone)
- newSlot("endpoint", Point clone)
+ origin ::= Point clone
+ endpoint ::= Point clone
- newSlot("selectedColor", Point clone set(.1, .475, .1, 1))
- newSlot("lineColor", Point clone set(.3, .3, .3, 1))
+ selectedColor ::= Point clone set(.1, .475, .1, 1)
+ lineColor ::= Point clone set(.3, .3, .3, 1)
- newSlot("isDangling", true)
- newSlot("isAttached", false)
+ isDangling ::= true
+ isAttached ::= false
- newSlot("hitThreshold", 6)
+ hitThreshold ::= 6
init := method(
setOrigin(Point clone)
View
2 addons/Flux/samples/Diagram/Selectable.io
@@ -1,5 +1,5 @@
Selectable := Object clone do(
- newSlot("isSelected", false)
+ isSelected ::= false
unselect := method(setIsSelected(false))
select := method(setIsSelected(true); setMoveOffset; self)
View
8 addons/Flux/samples/Self/main.io
@@ -18,7 +18,7 @@ app := Application clone do(
)
CloseButton := View clone do(
- newSlot("target", nil)
+ target ::= nil
size set(20, 20)
draw := method(
@@ -40,9 +40,9 @@ CloseButton := View clone do(
Lobby type := "Lobby"
ObjectView := View clone do(
- newSlot("title", "Lobby")
- newSlot("next", nil)
- newSlot("previous", nil)
+ title ::= "Lobby"
+ next ::= nil
+ previous ::= nil
setTarget := method(t,
writeln("OV setTarget")
View
4 addons/Flux/samples/Slideshow/main.io
@@ -12,8 +12,8 @@ Slide := Object clone do(
appendProto(OpenGL)
- newSlot("title", "")
- newSlot("bulletPoints", "")
+ title ::= ""
+ bulletPoints ::= ""
width := method(app width)
height := method(app height)
titleRatio := .95
View
2 addons/Flux/samples/SongJam/SJItem.io
@@ -1,6 +1,6 @@
SJItem := Object clone do(
- newSlot("path", "/")
+ path ::= "/"
init := method(
self items := nil
View
2 addons/Flux/samples/SongJam/Song.io
@@ -6,7 +6,7 @@ Song := Object clone do(
tracks empty
)
- newSlot("path", Path with(System launchPath, "Songs/Default.songjam"))
+ path ::= Path with(System launchPath, "Songs/Default.songjam")
open := method(
removeAllTracks
View
6 addons/Flux/samples/SongJam/SongJamNode.io
@@ -7,8 +7,8 @@ SongJamNode := Object clone do(
getfile := "http://www.songjam.com/sjremote.php?issh=[sessionkey]&page=sjmemberdownload&file=[path]"
)
- newSlot("username", "xxx")
- newSlot("password", "yyy")
+ username ::= "xxx"
+ password ::= "yyy"
urlNamed := method(name,
url := protocol getSlot(name) asMutable
@@ -34,7 +34,7 @@ SongJamNode := Object clone do(
sessionKey := nil
completed := nil
- newSlot("path", "/")
+ path ::= "/"
setPath := method(p,
if (p == "", p = "/")
View
4 addons/Flux/samples/SongJam/TracksView.io
@@ -3,7 +3,7 @@ TracksView := View clone do(
protoName := "TracksView"
tracks := method(subviews)
- newSlot("delegate", nil)
+ delegate ::= nil
soloTracks := 0
addTrack := method(track,
@@ -61,7 +61,7 @@ TracksView := View clone do(
/* --- Song -------------------------------- */
- newSlot("path", Path with(System launchPath, "Songs/Default.songjam"))
+ path ::= Path with(System launchPath, "Songs/Default.songjam")
open := method(p,
if (p, setPath(p))
View
6 addons/Font/samples/Terminal.io
@@ -3,9 +3,9 @@
Terminal := GLApp clone
Terminal do(
setAppName("Terminal")
- newSlot("leftMargin", 10)
- newSlot("bottomMargin", 10)
- newSlot("prompt", "Io> ")
+ leftMargin ::= 10
+ bottomMargin ::= 10
+ prompt ::= "Io> "
font := Font clone open("../../Flux/resources/fonts/ProFont/Mono/Normal.ttf") setPixelSize(25)
lines := List clone append(Sequence clone with(prompt))
View
4 addons/Font/samples/slides.io
@@ -14,8 +14,8 @@ Slide := Object clone do(
appendProto(OpenGL)
- newSlot("title", "")
- newSlot("bulletPoints", "")
+ title ::= ""
+ bulletPoints ::= ""
width := method(app width)
height := method(app height)
titleRatio := .95
View
4 addons/LZO/io/LZO.io
@@ -1,8 +1,8 @@
method(
m := message(
- newSlot("inputBuffer", nil)
- newSlot("outputBuffer", nil)
+ inputBuffer ::= nil
+ outputBuffer ::= nil
init := method(
setInputBuffer(Sequence clone)
View
6 addons/LibSndFile/samples/mp3filestream.io
@@ -7,9 +7,9 @@ AudioMixer := Object clone do(
self mixed := Sequence clone
)
- newSlot("streamDestination", AudioDevice)
- newSlot("processedSamples", 0)
- newSlot("isRunning", false)
+ streamDestination ::= AudioDevice
+ processedSamples ::= 0
+ isRunning ::= false
addSource := method(s, sources append(s))
removeSource := method(s, sources remove(s))
View
2 addons/Loki/tests/correctness/testcg.io
@@ -17,7 +17,7 @@ Loki Implementation linkToAs( Sequence, "getByteStringPointer" ) with(
Chrono := Object clone do(
- newSlot("timer",0)
+ timer ::= 0
// init := method( self timer := 0 )
View
4 addons/ODE/samples/extras/tutorial2.1.io
@@ -33,8 +33,8 @@ appendProto(OpenGL)
# Glut events object
Screen := Object clone do(
- newSlot("width", 512)
- newSlot("height", 512)
+ width ::= 512
+ height ::= 512
reshape := method( w, h,
setWidth(w) setHeight(h)
View
4 addons/ODE/samples/extras/tutorial2.2.io
@@ -34,8 +34,8 @@ appendProto(OpenGL)
# Glut events object
Screen := Object clone do(
- newSlot("width", 512)
- newSlot("height", 512)
+ width ::= 512
+ height ::= 512
reshape := method( w, h,
setWidth(w) setHeight(h)
View
4 addons/ODE/samples/tutorial2.io
@@ -32,8 +32,8 @@ appendProto(OpenGL)
# Glut events object
Screen := Object clone do(
- newSlot("width", 512)
- newSlot("height", 512)
+ width ::= 512
+ height ::= 512
reshape := method( w, h,
setWidth(w) setHeight(h)
View
10 addons/ODE/samples/tutorial3.io
@@ -125,12 +125,12 @@ contactgroup := world JointGroup clone
# Glut events object
Screen := Object clone do(
- newSlot("width", 640)
- newSlot("height", 480)
+ width ::= 640
+ height ::= 480
- newSlot("state", 0)
- newSlot("counter", 0)
- newSlot("objCount", 0)
+ state ::= 0
+ counter ::= 0
+ objCount ::= 0
reshape := method( w, h,
setWidth(w) setHeight(h)
View
6 addons/OpenGL/io/GLApp.io
@@ -15,8 +15,8 @@ Font drawOffsetString := method(text, offset,
GLApp := Object clone do(
//metadoc GLApp category Graphics
appendProto(OpenGL)
- newSlot("width", 1024)
- newSlot("height", 768)
+ width ::= 1024
+ height ::= 768
didReshape := nil
@@ -68,7 +68,7 @@ GLApp := Object clone do(
timer := method(nil)
- newSlot("appName", "io")
+ appName ::= "io"
didToggleFullScreen := nil
View
6 addons/OpenGL/io/ResourceManager.io
@@ -1,9 +1,9 @@
ResourceManager := Object clone do(
- newSlot("type", "ResourceManager")
+ type ::= "ResourceManager"
- newSlot("resourcesPath", Path with(Flux fluxPath, "resources"))
- newSlot("interfaceToolkit", "Flux")
+ resourcesPath ::= Path with(Flux fluxPath, "resources")
+ interfaceToolkit ::= "Flux"
/*
setResourcesPath := method(path,
View
2 addons/PortAudio/io/PortAudio.io
@@ -69,7 +69,7 @@ AudioMixer2 := Object clone do(
self mixed := Sequence clone setItemType("float32")
)
- newSlot("isRunning", false)
+ isRunning ::= false
play := method(buf, buffers append(buf clone setItemType("float32")))
View
4 addons/Rational/io/Rational.io
@@ -17,11 +17,11 @@ Rational := Object clone do(
//doc Rational numerator Returns the numerator.
//doc Rational setNumerator(aNumber) Sets the numerator. Returns self.
- newSlot("numerator", 0)
+ numerator ::= 0
//doc Rational denominator Returns the denominator.
//doc Rational setDenominator(aNumber) Sets the denominator. Returns self.
- newSlot("denominator", 0)
+ denominator ::= 0
//doc Rational with(aNumerator, aDenominator) Convenience constructor. Returns a new Rational number whose numerator and denominator are represented by the arguments aNumerator and aDenominator respectively.")
with := method(n, d,
View
6 addons/SampleRateConverter/samples/mp3filestream.io
@@ -7,9 +7,9 @@ AudioMixer := Object clone do(
self mixed := Sequence clone
)
- newSlot("streamDestination", AudioDevice)
- newSlot("processedSamples", 0)
- newSlot("isRunning", false)
+ streamDestination ::= AudioDevice
+ processedSamples ::= 0
+ isRunning ::= false
addSource := method(s, sources append(s))
removeSource := method(s, sources remove(s))
View
4 addons/SecureSocket/io/SecureServer.io
@@ -4,8 +4,8 @@ SecureServer do(
debugOn := method(self debugWriteln := getSlot("writeln"))
//debugOn
- newSlot("coro", nil)
- newSlot("dispatchCoro", nil)
+ coro ::= nil
+ dispatchCoro ::= nil
rawUseTLS := getSlot("useTLS")
rawUseDTLS := getSlot("useDTLS")
View
2 addons/SecureSocket/io/SecureSocket.io
@@ -50,7 +50,7 @@ SecureSocket do(
self readBuffer := Sequence clone
self writeBuffer := Sequence clone
self readEvent := self
- self newSlot("coro", nil)
+ coro ::= nil
self waitOn := method(
if(rbioReady, debugWriteln("bio already ready"); return true)
debugWriteln("fauxread")
View
16 addons/Socket/samples/IRC/CursesScreen.io
@@ -13,7 +13,7 @@ CursesView := Object clone do(
size = size clone
)
- newSlot("superview", nil)
+ superview ::= nil
redisplay := method(superview ?redisplay)
draw := method(
@@ -79,8 +79,8 @@ CursesScreen := Object clone do(
//size = size + 1
)
- newSlot("firstResponder", nil)
- newSlot("needsDisplay", 1)
+ firstResponder ::= nil
+ needsDisplay ::= 1
redisplay := method(needsDisplay = 1)
debugMessage := ""
@@ -112,10 +112,10 @@ CursesScreen := Object clone do(
// ----------------------------------------
CursesItem := Object clone do(
- newSlot("object", nil)
+ object ::= nil
setObject := method(v, object = getSlot("v"); self)
- newSlot("title", "")
- newSlot("isSelected", nil)
+ title ::= ""
+ isSelected ::= nil
subitems := method(
items := List clone
@@ -138,8 +138,8 @@ CursesItem := Object clone do(
)
CursesColumn := CursesView clone do(
- newSlot("delegate", nil)
- newSlot("selectedIndex", 0)
+ delegate ::= nil
+ selectedIndex ::= 0
size setWidth(30)
draw := method(
w := size width
View
8 addons/Socket/samples/IRC/IoBot.io
@@ -34,10 +34,10 @@ IoGoogleFeed := Feed clone do(
IRCClient := Object clone do(
socket := Socket clone
- newSlot("nickName", "ioalertbot")
- newSlot("userName", nickName)
- newSlot("userEmail", nickName .. "@foo.com")
- newSlot("channel", "io")
+ nickName ::= "ioalertbot"
+ userName ::= nickName
+ userEmail ::= nickName .. "@foo.com"
+ channel ::= "io"
feeds := list(IoMailingListFeed)
login := method(
View
12 addons/Socket/samples/MiniEmailServer.io
@@ -1,10 +1,10 @@
- v := Object clone do(
- newSlot("from", "")
- newSlot("to", nil)
- newSlot("cc", nil)
- newSlot("subject", "")
- newSlot("content", "")
+v := Object clone do(
+ from ::= ""
+ to ::= nil
+ cc ::= nil
+ subject ::= ""
+ content ::= ""
mailServerAddress := method(
host := to split("@") last
View
6 addons/SoundTouch/samples/mp3filestream.io
@@ -7,9 +7,9 @@ AudioMixer := Object clone do(
self mixed := Sequence clone
)
- newSlot("streamDestination", AudioDevice)
- newSlot("processedSamples", 0)
- newSlot("isRunning", false)
+ streamDestination ::= AudioDevice
+ processedSamples ::= 0
+ isRunning ::= false
addSource := method(s, sources append(s))
removeSource := method(s, sources remove(s))
View
16 addons/SystemCall/io/SystemCall.io
@@ -1,14 +1,14 @@
SystemCall do(
- newSlot("command", "")
- newSlot("isRunning", false)
- newSlot("returnCode", nil)
- newSlot("stdin", nil)
- newSlot("stdout", nil)
- newSlot("stderr", nil)
- newSlot("arguments", nil)
- newSlot("environment", Map clone)
+ command ::= ""
+ isRunning ::= false
+ returnCode ::= nil
+ stdin ::= nil
+ stdout ::= nil
+ stderr ::= nil
+ arguments ::= nil
+ environment ::= Map clone
init := method(
self arguments := List clone
View
4 addons/Zlib/io/Zlib.io
@@ -1,6 +1,6 @@
ZlibDecoder do(
- newSlot("inputBuffer", nil)
- newSlot("outputBuffer", nil)
+ inputBuffer ::= nil
+ outputBuffer ::= nil
init := method(
setInputBuffer(Sequence clone)
View
2 libs/iovm/io/UnitTest.io
@@ -110,7 +110,7 @@ TestSuite := Object clone do(
path asMutable pathComponent lastPathComponent
)
- newSlot("path", ".")
+ path ::= "."
/*doc TestSuite run
Collects and all files named *Test.io within the System launchPath directory,
View
14 libs/iovm/io/Z_CLI.io
@@ -1,14 +1,14 @@
CLI := Object clone do(
- newSlot("prompt", "Io> ")
- newSlot("outPrompt", "==> ")
- newSlot("continuedLinePrompt", " ")
+ prompt ::= "Io> "
+ outPrompt ::= "==> "
+ continuedLinePrompt ::= " "
- newSlot("context", method(Lobby))
- newSlot("isRunning", true)
+ context ::= method(Lobby)
+ isRunning ::= true
- newSlot("commandLineLabel", "Command Line")
+ commandLineLabel ::= "Command Line"
- newSlot("lineReader" , nil)
+ lineReader ::= nil
stop := method(setIsRunning(false))
View
4 samples/misc/ErlangChallenge.io
@@ -3,8 +3,8 @@
//Collector debugOn
Test := Object clone do(
- newSlot("next", nil)
- newSlot("id", nil)
+ next ::= nil
+ id ::= nil
ping := method(
//writeln("ping ", id)
if(next, next @@ping)
View
6 samples/speed/speedResults.io
@@ -41,9 +41,9 @@ slotNames := list(
"instantiations")
SpeedTestResult := Object clone do(
- newSlot("name", "")
- newSlot("color", "#888888")
- newSlot("fontColor", "#aaaaaa")
+ name ::= ""
+ color ::= "#888888"
+ fontColor ::= "#aaaaaa"
showBarFor := method(slotName, scale,
value := self getSlot(slotName)

0 comments on commit 4f86987

Please sign in to comment.