محتوای ارائه شده توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. تمام محتوای پادکست شامل قسمت‌ها، گرافیک‌ها و توضیحات پادکست مستقیماً توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones یا شریک پلتفرم پادکست آن‌ها آپلود و ارائه می‌شوند. اگر فکر می‌کنید شخصی بدون اجازه شما از اثر دارای حق نسخه‌برداری شما استفاده می‌کند، می‌توانید روندی که در اینجا شرح داده شده است را دنبال کنید.https://fa.player.fm/legal
Player FM - برنامه پادکست
با برنامه Player FM !
icon Daily Deals

Episode 003: Tic-Tac-REPL

23:09
 
اشتراک گذاری
 

Manage episode 221723276 series 2463849
محتوای ارائه شده توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. تمام محتوای پادکست شامل قسمت‌ها، گرافیک‌ها و توضیحات پادکست مستقیماً توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones یا شریک پلتفرم پادکست آن‌ها آپلود و ارائه می‌شوند. اگر فکر می‌کنید شخصی بدون اجازه شما از اثر دارای حق نسخه‌برداری شما استفاده می‌کند، می‌توانید روندی که در اینجا شرح داده شده است را دنبال کنید.https://fa.player.fm/legal

Nate tries to turn the tic-tac-toe "game engine" into a real application he can play with a friend.

  • Let's play the game!
  • How do you keep track of the game state as it changes?
  • Bucket brigade the reference to the future loop using recur
  • The game loop: read input, evaluate, print out new board, loop.
  • "It has occurred to me that we are basically writing a REPL."
  • "We have the tic-tac-REPL"
  • How do you get input from the user? How to you make sure it's right?
  • "It keeps harassing the non-compliment user until they type the right thing in"
  • Input loop: read, validate, loop on error, return on success
  • Keep the logic pure! Separate out the parsing and validation functions.
  • "Much better to tuck it away in a function!"
  • Sequence the pure parts with a minimalist function that does the I/O.
  • "I don't like having ovens present because they're hard to put in my test cases."
  • Unit test those pure parts. (No one likes to be mocked.)
  • I/O is a side effect!
  • "Every time I redefine one of those things I feel like I'm reaching down into the bowels of Clojure and doing something moderately illegal."
  • Using keywords as error codes is nifty
  • "You don't have any different kinds of nil. You just have one. It's the nuh-uh."
  • Can use a tuple with the first element always being a keyword and the second being data for the "details"

Clojure in this episode:

  • read-line
  • string/split
  • swap! and reset!
  • loop and recur
  • let vs loop
  • keywords
  • nil punning
  continue reading

118 قسمت

Episode 003: Tic-Tac-REPL

Functional Design in Clojure

94 subscribers

published

iconاشتراک گذاری
 
Manage episode 221723276 series 2463849
محتوای ارائه شده توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. تمام محتوای پادکست شامل قسمت‌ها، گرافیک‌ها و توضیحات پادکست مستقیماً توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones یا شریک پلتفرم پادکست آن‌ها آپلود و ارائه می‌شوند. اگر فکر می‌کنید شخصی بدون اجازه شما از اثر دارای حق نسخه‌برداری شما استفاده می‌کند، می‌توانید روندی که در اینجا شرح داده شده است را دنبال کنید.https://fa.player.fm/legal

Nate tries to turn the tic-tac-toe "game engine" into a real application he can play with a friend.

  • Let's play the game!
  • How do you keep track of the game state as it changes?
  • Bucket brigade the reference to the future loop using recur
  • The game loop: read input, evaluate, print out new board, loop.
  • "It has occurred to me that we are basically writing a REPL."
  • "We have the tic-tac-REPL"
  • How do you get input from the user? How to you make sure it's right?
  • "It keeps harassing the non-compliment user until they type the right thing in"
  • Input loop: read, validate, loop on error, return on success
  • Keep the logic pure! Separate out the parsing and validation functions.
  • "Much better to tuck it away in a function!"
  • Sequence the pure parts with a minimalist function that does the I/O.
  • "I don't like having ovens present because they're hard to put in my test cases."
  • Unit test those pure parts. (No one likes to be mocked.)
  • I/O is a side effect!
  • "Every time I redefine one of those things I feel like I'm reaching down into the bowels of Clojure and doing something moderately illegal."
  • Using keywords as error codes is nifty
  • "You don't have any different kinds of nil. You just have one. It's the nuh-uh."
  • Can use a tuple with the first element always being a keyword and the second being data for the "details"

Clojure in this episode:

  • read-line
  • string/split
  • swap! and reset!
  • loop and recur
  • let vs loop
  • keywords
  • nil punning
  continue reading

118 قسمت

همه قسمت ها

×
 
Loading …

به Player FM خوش آمدید!

Player FM در سراسر وب را برای یافتن پادکست های با کیفیت اسکن می کند تا همین الان لذت ببرید. این بهترین برنامه ی پادکست است که در اندروید، آیفون و وب کار می کند. ثبت نام کنید تا اشتراک های شما در بین دستگاه های مختلف همگام سازی شود.

 

icon Daily Deals
icon Daily Deals
icon Daily Deals

راهنمای مرجع سریع

در حین کاوش به این نمایش گوش دهید
پخش