목록OSSU_CS coursework (18)
무냐의 개발일지

XML은 트리형태로 써야하는 것을 txt형태로 쓰게 해준다. 대소문자, 꺽쇠 등등 | Equivalent Functions 어떤 경우에 동일한 함수라고 볼 수 있을까? 위의 함수 : 항상 double the variable아래 함수 : f를 두 번 호출하냐, 한 번 호출하냐에 따라 값이 다를 수 있겠지. 왼쪽은 hi를 2번 출력할테고, 오른쪽은 hi를 한 번 출력할테지

함수 자체를 인수로 넣는 거!First-Class function : 다른 함수의 인수로 아무데나 넣을 수 있는 성질의 함수 : 고차 함수 (higher-order funciton)Function Closure : First-class function 만들고 나서, 이걸 인수, local variable, 환경에 있는 것들 다 사용할 수 있는 함수 | Anonymous function1) fun triple x = 3*xfun triple_n_times1 (n,x) = n_times(triple,n,x)2) fun triple_n_times2 (n,x) = let fun triple x = 3*x in n_times(triple,n,x) end3) fun triple_n_times3 (n,x) = ..

순서는 상관없다. 어차피 매칭된 key의 값들이 있는거니까값이 많아질수록 tuples(position으로 접근)보다는 records(name으로 접근) 형식으로 쓰는게 당연히 기억하지 않아도 되고 편하겠지 mytype은 이 타입들 중 하나이다 | Pattern Matchingdatatype mytype = TwoInts of int * int | Str of string | Pizzafun f x = case x of Pizza => 3 | Str s => 8 | TwoInts(i1,i2) => i1 + i2(* | Pizza => 4; (* redundant case: error *) *)(*fun ..

(* Syntax : if e1 then e2 else e3where if, then, else are keywords ande1, e2, e3 are subexpressions* Type-checking : first e1 : boole2, e3 : can have any typebut they must have same typethe tye of the entire expressions is also same* Evaluation rules :first evaluate e1 to value call it v1if it's true, evaluate e2, else e3 and that result is the whole expression's result.*) | Errors tuples..
하 진짜 이거 안깔려서 수강 취소할 뻔했네 .. echo $SHELL이 결과가 If it ends in bash, you're using Bash. If it ends in zsh, you're using Zsh.나는 zsh를 사용하고 있었다 brew uninstall smlnj brew install --cask smlnj open -e .zshrc 파일 맨 밑줄에 이거 두 줄 추가하기export PATH="$PATH:/usr/local/smlnj/bin"export SMLNJ_HOME="/usr/local/smlnj" 환경에 저장하기source ~/.zshrc 디렉토리 확인하기 echo $PATHecho $SMLNJ_HOME 확인ls -l /usr/local/smlnj/bin/sml 이렇게 하면 ..

| Accumulator 말 그대로 뭔가를 누적해서 기억해야 한다는 뜻이다만약 홀수 번째에 있는 숫자만 추출하겠다고 하면, 모든 애들의 포지션을 기억하고 있어야하는 거파이썬으로 풀면 겁나 쉬운데, 이렇게 줄줄이 써놓으니까 눈에 진짜 안 들어오네 .... 이게 맞나 ... .ㅜㅜㅜ 이렇게 세 파트로 코드의 구조가 분리되어 있는 걸 눈으로 볼 수 있는게 진짜 중요한 자질이래!! | Tail Recursion 이 식의 result가 함수 전체의 결과가 될 것이니까, 이게 바로 tail position이다 ! 여기서는 bar 이 enclosing function이니까 ! 그냥 최종적으로 실행되는 애가 tail이라고 보면 된다 in a tailrecursive function, there are no pe..

alwyas start with the base case !!! 엄청 작은 CUTOFF 사이즈에 도달할때까지 반복한다 (check-expect (ssqr CUTOFF) (square CUTOFF "outline" "red"))(check-expect (ssqr (* 3 CUTOFF)) (overlay (square (* 3 CUTOFF) "outline" "red") (local [(define sub (square CUTOFF "outline" "red")) ..

One of the things that separates good programmers from the other kind is taking the time to improve the structure of their code once it is written. This material is super important, and... it is really important to practice doing it! Abstraction is a crucial technique for managing complexity in programs. - One aspect of this is that it can make programs smaller if the abstract functions are use..