 		@array = array.slice 0 #copy the array
 		@length = @array.length #cache length
 
-
-		clipHelpers = 
+		#Set the clipping helper method
+		throw "Invalid clip: #{config.clip}" unless @clipHelper = {
 			clamp: @clipHelperClamp
 			zero: @clipHelperZero
 			periodic: @clipHelperPeriodic
 			mirror: @clipHelperMirror
-
-		#Set the clipping helper method
-		@clipHelper = clipHelpers[config.clip]
-
-		throw "Invalid clip: #{config.clip}" unless @clipHelper?
-				
+		}[config.clip]
+
 
     # Get input array value at i, applying the clipping method
 	getClippedInput: (i) ->

class LinearInterpolator extends AbstractInterpolator
	interpolate: (t) ->
		k = Math.floor t
		a = @getClippedInput k
		b = @getClippedInput k+1
		#Translate t to interpolate between k and k+1
		t -= k
		return (1-t)*a + (t)*b


class CubicInterpolator extends AbstractInterpolator
	constructor: (array, config)->
		@tangentFactor = 1 - Math.max 0, Math.min 1, config.cubicTension
		super



			else throw "Invalid element type: #{dataType}"

	# Determine the end of the original function's domain
	if config.clip is 'periodic' then baseDomainEnd = arr.length #after last element for periodic
	else baseDomainEnd = arr.length - 1 #at last element for non-periodic

	config.scaleTo ||= baseDomainEnd #default scales to the end of the original domain for no effect
	
	properties.domain = normalizeScaleTo config.scaleTo
	smoothFunc = makeScaledFunction smoothFunc, baseDomainEnd, properties.domain
	properties.domain.sort()

	###copy properties###
	smoothFunc[k] = v for own k,v of properties
