Skip to content

Commit

Permalink
resolved change() overloaded builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jan 24, 2013
1 parent b324bc7 commit 5650b7f
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/ruby/ycp/builtins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module Builtins
# Overloaded Builtins
###########################################################

# Add a key/value pair to a map - add(<map>, <key>, <value)
# Create a new list with a new element - add(<list>, <value>)
# Add value to term - add(<term>, <value>)
# Add a path element to existing path - add(<path>, <value>)
# - Add a key/value pair to a map - add(<map>, <key>, <value)
# - Create a new list with a new element - add(<list>, <value>)
# - Add value to term - add(<term>, <value>)
# - Add a path element to existing path - add(<path>, <value>)
# Method that simulates behavior of add in ycp builtin.
# Most notably difference is that it always create new object
# For new code it is recommended to use directly methods on objects
Expand All @@ -26,6 +26,13 @@ def self.add object, *params
end
end

# - Changes a list. Deprecated, use LIST[size(LIST)] = value.
# - Change element pair in a map. Deprecated, use MAP[KEY] = VALUE.
def self.change
raise "Builtin change() is not implemented yet"
end


###########################################################
# YCP Byteblock Builtins
###########################################################
Expand Down Expand Up @@ -99,11 +106,6 @@ def self.tointeger
# YCP List Builtins
###########################################################

# Changes a list. Deprecated, use LIST[size(LIST)] = value.
def self.change
raise "Builtin change() is not implemented yet"
end

# contains() YCP built-in
# Checks if a list contains an element
def self.contains list, value
Expand Down Expand Up @@ -259,11 +261,6 @@ def self.union
# Map Builtins
###########################################################

# Change element pair in a map. Deprecated, use MAP[KEY] = VALUE.
def self.change
raise "Builtin change() is not implemented yet"
end

# Filter a Map
def self.filter
raise "Builtin filter() is not implemented yet"
Expand Down

0 comments on commit 5650b7f

Please sign in to comment.