This file contains 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
#include <iostream> | |
#include <cassert> | |
#include <cstring> | |
#include <iterator> | |
class Cons; | |
enum class Tag { int_, cons, string }; | |
class Lisp_ptr { |
This file contains 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
#include <iostream> | |
#include <cassert> | |
#include <cstring> | |
#include <iterator> | |
class Cons; | |
enum class Tag { int_, cons, string }; | |
class Lisp_ptr { |
This file contains 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
#include <iostream> | |
#include <cassert> | |
#include <cstring> | |
class Cons; | |
enum class Tag { int_, cons, string }; | |
class Lisp_ptr { | |
public: |
This file contains 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
#include <iostream> | |
#include <vector> | |
int main(){ | |
// 1,2,3,4,5 を持った vector | |
std::vector<int> hoge{1, 2, 3, 4, 5}; | |
for(auto i : hoge){ | |
std::cout << i << " "; | |
} | |
std::cout << '\n'; |
This file contains 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
#include <iostream> | |
#include <cassert> | |
#include <cstring> | |
class Cons; | |
enum class Tag { int_, cons, string }; | |
class Lisp_ptr { | |
public: |
This file contains 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
#include <iostream> | |
#include <cassert> | |
#include <cstring> | |
class Cons; | |
enum class Tag { int_, cons, string }; | |
class Lisp_ptr { | |
public: |
This file contains 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
(in-package :cl-user) | |
(destructuring-bind (a b c) | |
'(1 2 3) | |
(print a) ; 1 | |
(print b) ; 2 | |
(print c)) ; 3 | |
(terpri) |
This file contains 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
(in-package :cl-user) | |
;; 表示してまわったり | |
(dolist (p '(1 2 3)) | |
(print p)) | |
;; 和をとってみたり | |
(let ((accum 0)) | |
(dolist (p '(1 2 3 4 5)) | |
(incf accum p)) |
This file contains 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
(in-package :cl-user) | |
(setf lis1 (list 1 2 3)) | |
(print lis1) ; (1 2 3) | |
(setf lis2 (list 1 (list 2 3) (list 4 5))) | |
(print lis2) ; (1 (2 3) (4 5)) |
NewerOlder