DEV Community

Vee Satayamas
Vee Satayamas

Posted on

Common Lisp ไม่ใช่ระบบแบบที่ปล่อยให้ตายง่าย ๆ

Common Lisp เป็นระบบที่ไม่ตายง่าย ๆ ถ้าโปรแกรมที่เราใช้รันที 0.5 วินาที ก็คงไม่เป็นไร แต่ถ้าเริ่มโหลด data สัก 10 นาทีแล้วถึงจะทำงานต่อได้ หรือโปรแกรมต้องรันต่อกันสามวันก็คงไม่อยากจะเริ่มใหม่บ่อย ๆ จะ save state ลง disk กันบ่อย ๆ โปรแกรมก็เสร็จช้าเข้าไปอีก

Common Lisp เวลาเกิดข้อผิดพลาด กดจะส่งสัญญาณ (signal ที่เป็น verb) ที่มีสภาวะ (condition) ของข้อผิดพลาดและสภาวะแวดล้อมของข้อผิดพลาดแนบไปด้วย ตัวรับสัญญาณที่กำหนดไว้ก่อนว่าสภาวะไหนให้ทำอะไรก็ทำงานได้สารพัด ตั้งแต่พิมพ์อะไรออกมาบอกเฉย ๆ หรือกระโดดข้ามบางส่วน กลับไปทำโปรแกรมซ้ำอีกครั้ง หรือจัดการไม่ได้มันจะไปเรียก debugger ถามคนที่อยู่หน้าจอว่าให้ทำอะไรต่อ ส่วนที่ให้ถามว่าทำอะไรต่อก็กำหนดไว้ก่อนได้ว่าจะให้ทำอะไร เลือกแผน B แผน C ได้ มากไปกว่านั้นถ้าคนที่อยู่หน้าจอเป็น programmer ก็แก้โปรแกรมบางส่วนแล้วสั่งให้รันต่อได้

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere “thank you” often brightens someone’s day—share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay