Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Dictionary changes #13

Merged
merged 1 commit into from
May 28, 2020
Merged

Minor Dictionary changes #13

merged 1 commit into from
May 28, 2020

Conversation

mhavu
Copy link
Contributor

@mhavu mhavu commented May 28, 2020

Changed removeValueForKey(_:) to the current form removeValue(forKey:). Enabled the use of dot syntax in accessing key and value of a dictionary item. Added forEach as requested in issue #11.

…x in accessing key and value of an item, add forEach (issue #11)
@dwarfland dwarfland merged commit 9492055 into remobjects:master May 28, 2020
@mhavu mhavu deleted the dictionary branch May 29, 2020 05:03
@dwarfland
Copy link
Member

Fwiw, this change does not build :(, I'll have to undo it

	public func forEach(_ body: ((key: Key, value: Value)) throws -> Void) rethrows {
		for item in self {
			try body(item) // E400 No overloaded constructor with 1 parameter for type "func (_ arg0: Key, _ arg1: Value)"
		}
	}

dwarfland added a commit that referenced this pull request Jun 15, 2020
@mhavu
Copy link
Contributor Author

mhavu commented Jun 16, 2020

Sorry about that. Looks as if I hadn't tried building this version at all. 🤦‍♂️ How come the compiler is looking for a constructor and not a function given as argument, though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants