محتوای ارائه شده توسط 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 !
با برنامه Player FM !
Episode 003: Tic-Tac-REPL
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
usingrecur
- 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!
andreset!
loop
andrecur
let
vsloop
- keywords
nil
punning
118 قسمت
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
usingrecur
- 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!
andreset!
loop
andrecur
let
vsloop
- keywords
nil
punning
118 قسمت
همه قسمت ها
×به Player FM خوش آمدید!
Player FM در سراسر وب را برای یافتن پادکست های با کیفیت اسکن می کند تا همین الان لذت ببرید. این بهترین برنامه ی پادکست است که در اندروید، آیفون و وب کار می کند. ثبت نام کنید تا اشتراک های شما در بین دستگاه های مختلف همگام سازی شود.