10 2024 档案
摘要:《数据库》期中复习 只有两个重点:查询表的方法和设计表的模式。 第二章 关系数据模型 数据模型是用于描述数据或信息的标记,由数据结构、数据操作和数据上的约束条件组成。 一个关系的列被称为属性 attribute,关系名和其属性的集合称为关系的模式 schema,关系的每一行称为元组 tuple,元组
阅读全文
摘要:使用 Menhir 构建 SimPL 的编译器 Lexer and Parser 语法分析模块 Lexer, Parser, AST 是三个依次耦合的模块,可以这么描述三者的关系: Lexer tokens--> Parser nodes--> AST 相对于上面的图像化描述,cs3110 反过来构
阅读全文
摘要:下载 Dune opam install dune 创建项目 dune init project <project-name> 如果创建成功,有 Success: initialized project component named <project-name> 得到如下的一个文件结构 proje
阅读全文
摘要:(* Exercise: mutable fields *) type student = { name : string; mutable gpa : float; } let stuA = {name = "Alice"; gpa = 3.7} let () = stuA.gpa <- 4.0
阅读全文
摘要:(* Exercise: spec game *) (* Where is another programmer? *) (* Exercise: poly spec *) (* [Poly] represents immutable polynomials with integer coeffci
阅读全文
摘要:背景 这几天突击了一下 Cornell 的 cs3110;抽了两个下午刷完了 Chapter 3,4,5 的课后习题,很有感触。结合自己浅薄的函数式编程理解和贫瘠的 JavaScript / TypeScript 开发经历,总结一下自己第一阶段的函数式编程学习经历。😃 从 JavaScript 出
阅读全文
摘要:(* Exercise: complex synonym *) module type ComplexSig = sig type complex val zero : complex val add : complex -> complex -> complex end (* Exercise:
阅读全文
摘要:(* Exercise: mystery operator 1 *) let ( 2 + 2 与 square 2 + 2 的运行结果分别是 16 和 6 *) (* Exercise: repeat
阅读全文
摘要:(* Exercise: list expressions *) let list1 = [1; 2; 3; 4; 5];; let list2 = 1 :: 2 :: 3 :: 4 :: 5 :: [];; let list3 = [1] @ [2; 3; 4;] @ [5];; (* Exerc
阅读全文