chriseyre2000

chriseyre2000

Exploring Graphs with Elixir: Chapter 3 is missing some macros

Exploring Graphs with Elixir by @tonyhammond

I am unsure if the book is intended to be worked through to recreate the library (which is great for learning things).

When the macros are first used it includes use for both Graph and Query.
So far only the Graph using has been defined, and then it only creates the read_graph and write_graph methods.

First Post!

mvellandi

mvellandi

In
p.96 – Ch 3 > Storing Graphs in the Graph Store > Using Macros
the code comment in graph.ex

quote do
   # other (listings, new_graph) functions here
   def read_graph...
   def write_graph...
end

implies the author will define a few more functions later, or WE will add them on our own.

On the following page (97), we’re told we can check out the whole NativeGraph library functions:

iex> NativeGraph.[TAB]
...

which includes ALL the functions it will eventually output when ALL are defined in the using macros in both GraphCommons.Graph and GraphCommons.Query

The author just needs to update this code snippet to correspond with the next paragraph in the book.

Through the end of Ch 3, I see only two more functions used:
list_graphs
list_graphs_dir

which I started defining in the next subsection, where first used:
p.100 – Ch 3 > Storing Graphs in the Graph Store > Listing

NOTE: I just noticed the author didn’t include these two functions in the source code either.

Here’s what I additionally wrote in my GraphCommons.Graph using macro

quote do

      def list_graphs(file_test \\ :exists?) do
         GraphCommons.Graph.list_graphs(unquote(graph_type), file_test)
      end

      def list_graphs_dir(graph_dir) do
         GraphCommons.Graph.list_graphs_dir(graph_dir, unquote(graph_type))
      end

   def read_graph...
   def write_graph...

end

Where Next?

Popular Pragmatic Bookshelf topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
New

Other popular topics Top

AstonJ
Or looking forward to? :nerd_face:
New
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New

Sub Categories: