Smalltalk uses message passing, not method invocation. The distinction การแปล - Smalltalk uses message passing, not method invocation. The distinction ไทย วิธีการพูด

Smalltalk uses message passing, not

Smalltalk uses message passing, not method invocation. The distinction is subtle, but enormously powerful.

Some terminology: Given foo bar: baz, #bar: is a selector, foo is the receiver of a message called #bar: (the # indicates a symbol, much like Common Lisp would say 'bar (or even more appropriately, :bar)), and baz is an argument or parameter. When the line's executed, foo is sent the message #:bar: with argument baz. So far, it's pretty normal. In Java it would look like foo.bar(baz);.

In Java, the runtime system would figure out foo's actual type, find the most appropriate method, and run it.

Things look almost the same in Smalltalk. When you send an object a message, it searches in its method dictionary for a method whose name matches that of the selector of the message. If it can't find one, it searches in its superclass' method dictionary, and so on. Pretty normal stuff.

If it can't find any matching method, it sends itself the #doesNotUnderstand: message, with the original message as a parameter. (Yes, a message send is an object.) But #doesNotUnderstand: is also just a method. You can override it.

For instance, you can have an object that responds to some set of messages while forwarding any other messages it receives to some delegate object. Override #doesNotUnderstand: and hey presto, you have a proxy that will need no maintenance to keep its protocol in sync with the delegate.
0/5000
จาก: -
เป็น: -
ผลลัพธ์ (ไทย) 1: [สำเนา]
คัดลอก!
ภาษาสมอลล์ทอล์กใช้ข้อความช่วย เมธไม่ แตกเป็นรายละเอียด แต่มีประสิทธิภาพมหาศาลบางคำศัพท์: ให้ฟูบาร์: บินบาซ #bar: เป็นตัวเลือก ฟูเป็นผู้รับข้อความที่เรียกว่า #bar: (#บ่งชี้สัญลักษณ์ ภาษาลิสป์ทั่วไปเหมือนจะบอกว่า ' บาร์ (หรือยิ่งเหมาะ สม,: บาร์)), และบินบาซเป็นอาร์กิวเมนต์หรือพารามิเตอร์ รายการของใช้ ฟูส่งข้อความ #: บาร์: ด้วยอาร์กิวเมนต์บินบาซ เพื่อห่างไกล ไม่สวยปกติ ใน Java นั้นจะดูเหมือน foo.bar(baz)ในจาวา ระบบรันไทม์จะทราบชนิดของฟูจริง ค้นหาวิธีการที่เหมาะสม และเรียกใช้สิ่งที่ดูเกือบเหมือนกันในภาษาสมอลล์ทอล์ก เมื่อคุณส่งข้อความ จะค้นหาในพจนานุกรมของวิธีการสำหรับวิธีการที่มีชื่อตรงกับตัวเลือกของข้อความ ถ้ามันไม่หา จะค้นหาในซุปเปอร์คลาสของพจนานุกรมวิธี และอื่น ๆ สิ่งปกติสวยถ้ามันไม่สามารถหาวิธีการจับคู่ใด ๆ มันส่งตัวเอง #doesNotUnderstand: ข้อความ ข้อความต้นฉบับเป็นพารามิเตอร์ (ใช่ ส่งข้อความเป็นวัตถุ) แต่ #doesNotUnderstand: เป็นเพียงวิธีการ คุณสามารถแทนได้ตัวอย่าง คุณสามารถมีวัตถุที่ตอบสนองบางชุดของข้อความขณะที่ส่งข้อความอื่น ๆ ที่ได้รับมอบหมายวัตถุบางอย่าง แทน #doesNotUnderstand: และเฮ presto คุณมีพร็อกซีที่จะต้องบำรุงรักษาไม่ให้ของโพรโทคอลให้ตรงกันกับผู้รับมอบสิทธิ์
การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 2:[สำเนา]
คัดลอก!
Smalltalk uses message passing, not method invocation. The distinction is subtle, but enormously powerful.

Some terminology: Given foo bar: baz, #bar: is a selector, foo is the receiver of a message called #bar: (the # indicates a symbol, much like Common Lisp would say 'bar (or even more appropriately, :bar)), and baz is an argument or parameter. When the line's executed, foo is sent the message #:bar: with argument baz. So far, it's pretty normal. In Java it would look like foo.bar(baz);.

In Java, the runtime system would figure out foo's actual type, find the most appropriate method, and run it.

Things look almost the same in Smalltalk. When you send an object a message, it searches in its method dictionary for a method whose name matches that of the selector of the message. If it can't find one, it searches in its superclass' method dictionary, and so on. Pretty normal stuff.

If it can't find any matching method, it sends itself the #doesNotUnderstand: message, with the original message as a parameter. (Yes, a message send is an object.) But #doesNotUnderstand: is also just a method. You can override it.

For instance, you can have an object that responds to some set of messages while forwarding any other messages it receives to some delegate object. Override #doesNotUnderstand: and hey presto, you have a proxy that will need no maintenance to keep its protocol in sync with the delegate.
การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 3:[สำเนา]
คัดลอก!
Smalltalk ใช้ข้อความผ่าน ไม่ใช่วิธีการ . ความแตกต่างคือ บอบบาง แต่ทรงพลังมหาศาล

บางศัพท์ : ให้ฟูบาร์ : baz : เป็น#บาร์ , เลือกฟูเป็นผู้รับของข้อความ เรียกว่า#บาร์ : ( #แสดงสัญลักษณ์ , มากเช่น Lisp สามัญจะบอกว่า ' บาร์ ( หรือมากขึ้นอย่างเหมาะสม : บาร์ ) ) และ บาซเป็นอาร์กิวเมนต์และพารามิเตอร์ เมื่อสายถูกประหารชีวิตฟูจะส่งข้อความ# : บาร์ : บาซ อาร์กิวเมนต์ มันเป็นเรื่องปกติสวย ในจาวา มันจะดูเหมือนฟูบาร์ ( บาส ) ; .

ใน Java ระบบรันไทม์จะคิดออกฟูจริง ประเภท หาวิธีที่เหมาะสมที่สุด และเรียกได้

สิ่งที่ดูเป็นเกือบเดียวกันในธ . เมื่อคุณส่งวัตถุข้อความค้นหาในวิธีการของพจนานุกรมสำหรับวิธีการที่มีชื่อตรงกับที่ของตัวเลือกของข้อความ ถ้ามันหาไม่เจอก็ค้นหาในของซูเปอร์คลาส ' วิธีพจนานุกรมและอื่นๆ เรื่องปกติสวย

ถ้ามันไม่สามารถหาวิธีการจับคู่ มันส่งเอง# doesnotunderstand : ข้อความ , ข้อความต้นฉบับเป็นพารามิเตอร์ ( ครับ ข้อความที่ส่งเป็นวัตถุ) แต่# doesnotunderstand : ยังเป็นเพียงวิธีการ คุณสามารถแทนที่ได้

สำหรับอินสแตนซ์ คุณสามารถมีวัตถุที่ตอบสนองต่อบางชุดของข้อความในขณะที่อื่น ๆที่ได้รับมอบหมาย ข้อความบางวัตถุการส่งต่อ . แทนที่# doesnotunderstand : และนี่ Presto คุณมีตัวแทนที่จะต้องปรับปรุงเพื่อให้โปรโตคอลในซิงค์กับที่มอบหมาย
การแปล กรุณารอสักครู่..
 
ภาษาอื่น ๆ
การสนับสนุนเครื่องมือแปลภาษา: กรีก, กันนาดา, กาลิเชียน, คลิงออน, คอร์สิกา, คาซัค, คาตาลัน, คินยารวันดา, คีร์กิซ, คุชราต, จอร์เจีย, จีน, จีนดั้งเดิม, ชวา, ชิเชวา, ซามัว, ซีบัวโน, ซุนดา, ซูลู, ญี่ปุ่น, ดัตช์, ตรวจหาภาษา, ตุรกี, ทมิฬ, ทาจิก, ทาทาร์, นอร์เวย์, บอสเนีย, บัลแกเรีย, บาสก์, ปัญจาป, ฝรั่งเศส, พาชตู, ฟริเชียน, ฟินแลนด์, ฟิลิปปินส์, ภาษาอินโดนีเซี, มองโกเลีย, มัลทีส, มาซีโดเนีย, มาราฐี, มาลากาซี, มาลายาลัม, มาเลย์, ม้ง, ยิดดิช, ยูเครน, รัสเซีย, ละติน, ลักเซมเบิร์ก, ลัตเวีย, ลาว, ลิทัวเนีย, สวาฮิลี, สวีเดน, สิงหล, สินธี, สเปน, สโลวัก, สโลวีเนีย, อังกฤษ, อัมฮาริก, อาร์เซอร์ไบจัน, อาร์เมเนีย, อาหรับ, อิกโบ, อิตาลี, อุยกูร์, อุสเบกิสถาน, อูรดู, ฮังการี, ฮัวซา, ฮาวาย, ฮินดี, ฮีบรู, เกลิกสกอต, เกาหลี, เขมร, เคิร์ด, เช็ก, เซอร์เบียน, เซโซโท, เดนมาร์ก, เตลูกู, เติร์กเมน, เนปาล, เบงกอล, เบลารุส, เปอร์เซีย, เมารี, เมียนมา (พม่า), เยอรมัน, เวลส์, เวียดนาม, เอสเปอแรนโต, เอสโทเนีย, เฮติครีโอล, แอฟริกา, แอลเบเนีย, โคซา, โครเอเชีย, โชนา, โซมาลี, โปรตุเกส, โปแลนด์, โยรูบา, โรมาเนีย, โอเดีย (โอริยา), ไทย, ไอซ์แลนด์, ไอร์แลนด์, การแปลภาษา.

Copyright ©2025 I Love Translation. All reserved.

E-mail: