edgedb / easy-edgedb

An illustrated textbook designed to be a one-stop shop for learning EdgeDB
https://www.edgedb.com/easy-edgedb
69 stars 36 forks source link

Make Time global, change later global type to different enum, other rewriting #104

Closed Dhghomon closed 1 year ago

Dhghomon commented 1 year ago

This is the first of a few PRs to deal with parts of the original book that I find dissatisfying. One of them is the Time type which never really did anything except float around as a few objects unrelated to anything else. Was going to delete it but it seems like a good way to introduce globals earlier on so this part has been rewritten in Chapter 4. Chapter 14 has its own time-related global scalar though so this has also been changed to another global: an enum that differentiates between Info and Debug mode (e.g. so a game tester can select between testing the game as a regular player vs. testing the game with extra info).

Will add examples of updating the global Time object and a constraint to disallow any inserts past the first one but this branch has quite a few changes already so will merge first.