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

telemachus
Python Testing With Pytest - Chapter 2, warnings for “unregistered custom marks” While running the smoke tests in Chapter 2, I get these...
New
johnp
Hi Brian, Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New

Sub Categories: