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

Popular Prag Prog topics Top

Razor54672
The answer to 3rd Problem of Chapter 5 (Making Choices) of “Practical Programming, Third Edition” seems incorrect in the given answer ke...
New
jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
New
JohnS
I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps. With: ruby-3.0.0 s...
New
HarryDeveloper
Hi @venkats, It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
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
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New

Other popular topics Top

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
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
foxtrottwist
Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
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
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New

Latest in PragProg

View all threads ❯