- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
On Ground Sorting University of Virginia在地面上排序弗吉尼亚大学
25 February 2004 CS 200 Spring 2004 David Evans /evans Menu Mutation Primitives Programming with Mutation PS 5 Evaluation Rule 2: Names If the expression is a name, it evaluates to the value associated with that name. Names and Places A name is not just a value, it is a place for storing a value. define creates a new place, associates a name with that place, and stores a value in that place Bang! set! (“set bang”) changes the value associated with a place set! should make you nervous Defining nextx Evaluation Rules set-car! and set-cdr! (set-car! p v) Replaces the car of the cons p with v. (set-cdr! p v) Replaces the cdr of the cons p with v. Functional Programming Programming without mutation Side-effects like printing and drawing on the screen are really mutations (of the display, printer, bell, etc.) If an expression has a value, it is always the same – order of evaluation doesn’t matter Substitution model of evaluation works fine Imperative Programming Programming with mutation (assignment) Value of an expression might be different depending on when it is evaluated Substitution model of evaluation doesn’t work anymore! Why Substitution Fails? Why would a programming language allow mutation? Does it allow us to express computations we couldn’t express without it? No! We can express all computations without mutation. (We’ll see why before the end of the course…) Mutation allows us to express some computations more naturally and efficiently But it also makes everything else more complicated map Functional Solution: A procedure that takes a procedure of one argument and a list, and returns a list of the results produced by applying the procedure to each element in the list. Imperative Solution A procedure that takes a procedure and list as arguments, and replaces each element in the list with the value of the procedure applied to that element. Programming with Mutation PS5: Databases Database is tables of fields containing values Commands for insertin
您可能关注的文档
- Nonparametric Techniques Southeast Missouri State 非参数技术东南密苏里州.ppt
- NonRenewable Resources black goldpetroleum不可再生资源的黑goldpetroleum.pptx
- Nonmonotonic Negativity 東京理科大学非单调性東京理科大学.ppt
- NonPest Disorders Landscape Weeds无病虫害及景观杂草.ppt
- NonSequitur不合理的推论.pptx
- NONSTANDARD APPROACHES Flight Operations非标准方法飞行操作.pptx
- Nonparametric Scene Parsing via Label Transfer Tamara Berg非参数的现场分析通过标签转移塔玛拉贝格.pptx
- Nonverbal Bakersfield College非言语贝克斯菲尔德学院.pptx
- NonVerbal Utah Education Network非语言教育网.ppt
- Nonverbal Communication sps186非语言交际sps186.ppt
- On Hoare Logic and Kleene Algebra with Tests在Hoare逻辑和克莱尼代数与测试.ppt
- On Improving the Performance of RoleBased Cascaded Delegation关于提高基于角色的级联授权的性能研究.ppt
- On Ideal Lattices and Learning With Errors Over Rings关于理想格与环上误差的学习.ppt
- On Individual and Aggregate TCP Performance对个人和TCP性能.ppt
- On Jordan's Stormy Banks Paperless Hymnal乔丹的暴风雨的银行无纸化的赞美诗.ppt
- On Mining Group Patterns of Mobile Users mis移动用户的挖掘群体模式管理信息系统.nsysu.tw.ppt
- On Obligations and Abilities IPI PAN在义务和能力IPI的锅.ppt
- On Proof Systems Behind Efficient SAT Solvers高效的坐在解算器背后的证明系统.ppt
- On revient sur les notions de secondaire 4 Accueil我们的概念中四至中接待.ppt
- On the Characteristics and Origins of Internet Flow Rates论网络流量的特征及其成因.ppt
最近下载
- 2024金属屋面板做法图集.docx VIP
- 基于知识图谱的学习路径推荐策略研究.pdf VIP
- 《航空运输地理》第5章世界航空运输布局.ppt
- 16J916-1 住宅排气道㈠国标 建筑图集 汇编 .docx VIP
- 2025年文化旅游产业融合发展社会稳定风险评估报告.docx
- 广美版(2024)小学美术二年级上册《多功能雨具》教学设计.docx
- 统编版道德与法治三年级上册第7课《走近我们的老师》教学设计.docx VIP
- 自然灾害练习题(含解析).docx VIP
- 2025年中考英语考纲词汇(包括词性,词义,词转,短语).pdf VIP
- 人教版道德与法治三年级上册第7课《走近我们的老师》课件.pptx VIP
原创力文档


文档评论(0)