Created
March 27, 2014 16:40
-
-
Save maltzsama/9811988 to your computer and use it in GitHub Desktop.
Person Class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defstruct person :first-name :last-name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** | |
| * Excerpted from "Programming Clojure", | |
| * published by The Pragmatic Bookshelf. | |
| * Copyrights apply to this code. It may not be used to create training material, | |
| * courses, books, articles, and the like. Contact us if you are in doubt. | |
| * We make no guarantees that this code is fit for any purpose. | |
| * Visit http://www.pragmaticprogrammer.com/titles/shcloj for more book information. | |
| ***/ | |
| public class Person { | |
| private String firstName; | |
| private String lastName; | |
| public Person(String firstName, String lastName) { | |
| this.firstName = firstName; | |
| this.lastName = lastName; | |
| } | |
| public String getFirstName() { | |
| return firstName; | |
| } | |
| public void setFirstName(String firstName) { | |
| this.firstName = firstName; | |
| } | |
| public String getLastName() { | |
| return lastName; | |
| } | |
| public void setLastName(String lastName) { | |
| this.lastName = lastName; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| @interface Person : NSObject | |
| @property (nonatomic, strong) NSString *first-name; | |
| @property (nonatomic, strong) NSString *last-name; | |
| @interface Person () | |
| @end | |
| @implementation Person |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Haskell: