norvig / paip-lisp

Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about markdown syntax

casouri opened this issue · comments

Is there any reason to use quoting syntax for code evaluations and use <code> tags instead of backticks for inline code marking? Besides these, I see HTML tables in source files.

For example:

> \> 'John &rArr; JOHN 

> \> '(John Q Public) &rArr; (JOHN Q PUBLIC) 

> \> '2 &rArr; 2 

> \> 2 &rArr; 2 

> \> '(+ 2 2) &rArr; (+ 2 2) 

> \> (+ 2 2) &rArr; 4 

> \> John &rArr; Error: JOHN is not a bound variable 

> \> (John Q Public) &rArr; Error: JOHN is not a function 

and

Note that <code>'2</code> evaluates to <code>2</code> because it is a quoted expression, and <code>2</code> evaluates to <code>2</code> because numbers valuate to themselves. Same result, different reason. In contrast, <code>'John</code> evaluates to <code>John</code> because it is a quoted expression, but evaluating <code>John</code> leads to an error, because evaluating a symbol means getting the value of the symbol, and no value has been assigned to <code>John</code>. 

and

<table>
  <tr>
    <td>defun</td>
    <td>define function</td>
  </tr>
  <tr>
    <td>defparameter</td>
    <td>define special variable</td>
  </tr>
  <tr>
    <td>setf</td>
    <td>set variable or field to new value</td>
  </tr>
  <tr>
    <td>let</td>
    <td>bind local variable(s)</td>
  </tr>
  <tr>
    <td>case</td>
    <td>choose one of several alternatives</td>
  </tr>
  <tr>
    <td>if</td>
    <td>do one thing or another, depending on a test</td>
  </tr>
  <tr>
    <td>function (#')</td>
    <td>refer to a function</td>
  </tr>
  <tr>
    <td>quote (')</td>
    <td>introduce constant data</td>
  </tr>
</table>

Can you clarify what you think the problem is? You gave an example, but I didn't understand what you think is wrong with it, or what you propose to change. Perhaps link to a file and line where the problem is within the repo.

As written, I'm reading your question as "why use backticks?". And the only answer I can think of is "because it's markdown syntax".

re: your html tables question, is that the same issue or a separate topic from the code formatting?

Let me know if I understand you correctly. Looking at chapter 1:

  1. There's quoting used, like > for blockquotes, to indent code, instead of code blocks, with ``` before and after.
  2. We're using <code> instead of backticks: `
  3. We're using <table> instead of Markdown tables.

You'd rather we use Markdown when we can, instead of html. I agree with this.

I agree with using Markdown as much as possible.

I need to improve my writing skills 😂

@pronoiac Yes, that's exactly what I mean.

If you guys prefer markdown syntax, I'm going to change quotes to code blocks, <code> to backticks and <table> to markdown tables while I read through the book.

@casouri, there's news: we imported chapters from a cleaner source. (There are major changes. You should probably pull down the changes before doing much editing.) There's lots of cleanup to do - the conversion tool is a work in progress - but at least <code> and <table> are gone.

Cool 😄

Is this issue handled? Can we close it?

Yeah