Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
playground:playground [2020/01/14 15:12] – external edit 127.0.0.1playground:playground [2021/02/07 03:15] (current) – external edit 127.0.0.1
Line 1: Line 1:
 = PlayGround = = PlayGround =
  
-<sxh csharp> 
-using System; 
-using System.Collections; 
-using System.Collections.Generic; 
-using System.Linq; 
  
-namespace ConsoleApplication1 +<code clojure> 
-{ +(defn do-something [] 
-    public class DataManager + (println "Hello, world!")) 
-    { +</code>
-        public static MyClassManager MyClass { get { return MyClassManager.Instance; } } +
-    }+
  
- 
- 
-    /* 1단계 */ 
- 
-    public class MyClassManager 
-    { 
-        private List<MyClass> myList = new List<MyClass>(); 
- 
-        private static MyClassManager instance = null; 
- 
-        private MyClassManager() { } 
- 
-        public static MyClassManager Instance 
-        { 
-            get 
-            { 
-                if (instance == null) 
-                    instance = new MyClassManager(); 
- 
-                return instance; 
-            } 
-        } 
- 
-        public void Add(int a, int b) 
-        { 
-            myList.Add(new MyClass(a, b)); 
-        } 
- 
-        public void RemoveAt(int index) 
-        { 
-            myList.RemoveAt(index); 
-        } 
- 
-        public MyClass ElementAt(int index) 
-        { 
-            return myList.ElementAt(index); 
-        } 
- 
-        public int Length 
-        { 
-            get 
-            { 
-                return myList.Count; 
-            } 
-        } 
-    } 
- 
-    public class MyClass 
-    { 
-        public SubClassManager myCustomList = new SubClassManager(); 
- 
- 
-        public int a, b; 
- 
-        public MyClass(int a, int b) 
-        { 
-            this.a = a; 
-            this.b = b; 
- 
-        } 
-    } 
- 
- 
- 
-    /* 2단계 - 마치 List처럼 전체 재정의 */ 
- 
-    public class SubClassManager 
-    { 
-        /* Singleton 사용X */ 
-        private List<SubClass> myList = new List<SubClass>(); 
- 
-        public void Add(int x, int y) 
-        { 
-            myList.Add(new SubClass(x, y)); 
-        } 
- 
-        public SubClass this[int index] 
-        { 
-            get 
-            { 
-                return myList[index]; 
-            } 
-            set 
-            { 
-                myList[index] = value; 
-            } 
-        } 
-    } 
- 
-    public class SubClass 
-    { 
-        public SubClass(int x, int y) 
-        { 
-            this.x = x; 
-            this.y = y; 
-        } 
- 
- 
-        public int x { get; set; } 
-        public int y { get; set; } 
-    } 
-} 
-</sxh> 
playground/playground.1579014733.txt.gz · Last modified: (external edit)