Smalltalk-80 syntax is rather minimalist, based on only a handful of declarations and reserved words. In fact, only six "keywords" are reserved in Smalltalk: true, false, nil, self, super, and thisContext. These are actually called pseudo-variables, identifiers that follow the rules for variable identifiers but denote bindings that the programmer cannot change. The true, false, and nil pseudo-variables are singleton instances. self and super refer to the receiver of a message within a method activated in response to that message, but sends to super are looked up in the superclass of the method's defining class rather than the class of the receiver, which allows methods in subclasses to invoke methods of the same name in superclasses. thisContext refers to the current activation record. The only built-in language constructs are message sends, assignment, method return and literal syntax for some objects. From its origins as a language for children of all ages, standard Smalltalk syntax uses punctuation in a manner more like English than mainstream coding languages. The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library. (For performance reasons, implementations may recognize and treat as special some of those messages; however, this is only an optimization and is not hardwired into the language syntax.)
smalltalk-80 เป็นไวยากรณ์ที่เรียบง่ายแต่ใช้เพียงเล็กน้อยของการประกาศและสงวนคำ ในความเป็นจริง , เพียงหก " คำหลัก " ที่สงวนไว้ในเพิร์ล : จริงเท็จ , นิล , ด้วยตนเอง , ซูเปอร์ และ thiscontext . เหล่านี้เป็นจริงเรียกว่าตัวแปรเทียมระบุว่าตามกฎสำหรับการระบุตัวแปร แต่แสดงถึงผูกที่โปรแกรมเมอร์ไม่สามารถเปลี่ยน ความจริง เท็จนิลเทียมและตัวแปร Singleton กรณี ตนเอง และซูเปอร์หมายถึงผู้รับของข้อความภายในวิธีการเปิดใช้งานในการตอบสนองต่อข้อความนั้น แต่ส่งซูเปอร์มองขึ้นในซูเปอร์คลาสของวิธีการกำหนดชั้นมากกว่าชั้นของผู้รับ ซึ่งจะช่วยให้วิธีการในคลาสจะเรียกวิธีการของชื่อเดียวกันใน superclasses .thiscontext หมายถึงการบันทึกการเปิดใช้งานปัจจุบัน ภาษาเดียวในตัวโครงสร้างเป็นข้อความส่ง , งาน , วิธีการกลับมาและอักษรไวยากรณ์วัตถุบางอย่าง จากต้นกำเนิดของมันเป็นภาษาสำหรับเด็กทุกเพศทุกวัย , Smalltalk ใช้เครื่องหมายวรรคตอนไวยากรณ์มาตรฐาน ในลักษณะเหมือนภาษาอังกฤษกว่าการเข้ารหัสภาษาหลัก ส่วนที่เหลือของภาษารวมถึงการควบคุมโครงสร้างการประเมินเงื่อนไขซ้ำ , ใช้ด้านบนของตัวโครงสร้างตามมาตรฐาน Smalltalk ชั้นห้องสมุด ( สำหรับเหตุผลประสิทธิภาพการใช้งานอาจจะรู้จักและรักษาเป็นพิเศษบางข้อความ เหล่านั้น อย่างไรก็ตาม นี้เป็นเพียงการเพิ่มประสิทธิภาพและยังฝังอยู่ในภาษา ไวยากรณ์ )
การแปล กรุณารอสักครู่..
