Nil:
Filter:
Classes | Core

Nil : Object

Represents uninitialized data
Source: Nil.sc

Description

Nil has a single instance named nil and is used to represent uninitialized data, bad values, or terminal values such as end-of-stream.

NOTE: Take note that Nil is a class and not the special value nil. Comparing Nil and nil will return false. In normal use you should not need to use this class directly: use nil

Class Methods

Inherited class methods

Undocumented class methods

Nil.new

Instance Methods

.isNil

Answers true because this is nil. In class Object this message is defined to answer false.

.notNil

Answer false. In class Object this message answers true.

?(obj)

return first non-nil argument. Since this IS nil then return anObject. In class Object, ? is defined to answer the receiver.

??(obj)

If the receiver is nil, evaluate the function and return the result. Since this IS nil, then evaluate the function and return the result. In class Object, ?? is defined to answer the receiver.

.booleanValue

Returns false.

.rate

Returns nil.

.numChannels

Returns nil.

.isPlaying

Returns false.

.dependants

Returns an empty IdentitySet.

.awake(inBeats, inSeconds, inClock)

Returns nil.

.nextTimeOnGrid(clock)

Returns clock.nextTimeOnGrid.

.asQuant

Returns Quant.default.

.matchItem

Returns true.

See also matchItem.

.asCollection

Returns empty array.

.get(prevVal)

Returns prevVal.

.asSpec

Returns the default ControlSpec

.handleError(error)

Either report error or inspect error and halt execution.

.push(function)

Executes function.

.appendStream(stream)

Returns stream.

Dependancy

All the messages for the Dependancy protocol (See class Object) are defined in class Nil to do nothing. This eliminates the need to check for nil when sending dependancy messages.

Other Methods

Many other messages are defined in class Nil to do nothing. This eliminates the need to check for nil.

Generic Collectors

There are a number of methods that can be applied to nil so that variables do not need to be initialized. Nil is just the "ground" (default case) from which the rest is bootstrapped.

.add(value)

Returns an array with the value. This makes it unnecessary to initialize when adding to a variable.

.addAll(array)

Returns an array with all the values. This makes it unnecessary to initialize when adding to a variable.

.remove

For nil, it just returns nil. This makes it unnecessary to initialize when removing from a variable and adding to it again.

++(array)

Returns an array with all the values. This makes it unnecessary to initialize when adding to a variable.

.addFunc( ... functions)

Returns a function or a FunctionList. This method is used to add multiple functions to already existing ones.

.removeFunc

This method is used to remove multiple functions from already existing ones. For Nil, it just returns itself.

.transformEvent(event)

This method is used to operate on events which are passed through the system as an argument.

Inherited instance methods

Undocumented instance methods

.asBoolean

.asBus(rate, numChannels: 1, server)

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asBus.sc

.asEvent

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Streams/Rest.sc

.asGroup

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asGroup.sc

.asMIDIInPortUID

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asMIDIPort.sc

.asNodeID

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asTarget.sc

.asOSCArgArray

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/extConvertToOSC.sc

.asTarget

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asTarget.sc

.collectCopy

.collectInPlace

.replaceFunc

.schedBundle(bundle, server, timeOfRequest)

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/schedBundle.sc

.seconds =