Example 7.6.1 (Third Tutorial) not working here #106

Closed
opened 8 years ago by th · 3 comments
th commented 8 years ago (Migrated from github.com)

Hi,

this is Racket Windows 6.3 on Windows.

The example is:

lang pollen

◊(require racket/math)
Pi is close to ◊|pi|.
The hyperbolic sine of pi is close to ◊(sinh pi).

The expected output:

'(root "Pi is close to " 3.141592653589793 "." "\n" "The hyperbolic sine of pi is close to " 11.548739357257748 ".")

Actual output:

......\AppData\Roaming\Racket\6.3\pkgs\pollen\reader-base.rkt:56:13: pollen markup error: '(root "Pi is close to " 3.141592653589793 "." "\n" "The hyperbolic sine of pi is close to " 11.548739357257748 "." "\n" "\n" "\n" "\n") is not a list starting with a symbol

I think I do see a list with a symbol there.

If I lose the require and just define pi myself – ◊define[pi]{3.1} – it's fine.
Output then:

'(root "Pi is close to " "3.14" "." "\n" "The hyperbolic sine of pi is close to " (sinh "3.14") "." "\n" "\n" "\n" "\n" "\n")

Hi, this is Racket Windows 6.3 on Windows. The example is: # lang pollen ◊(require racket/math) Pi is close to ◊|pi|. The hyperbolic sine of pi is close to ◊(sinh pi). The expected output: '(root "Pi is close to " 3.141592653589793 "." "\n" "The hyperbolic sine of pi is close to " 11.548739357257748 ".") Actual output: ......\AppData\Roaming\Racket\6.3\pkgs\pollen\reader-base.rkt:56:13: pollen markup error: '(root "Pi is close to " 3.141592653589793 "." "\n" "The hyperbolic sine of pi is close to " 11.548739357257748 "." "\n" "\n" "\n" "\n") is not a list starting with a symbol I think I do see a list with a symbol there. If I lose the require and just define pi myself – ◊define[pi]{3.1} – it's fine. Output then: '(root "Pi is close to " "3.14" "." "\n" "The hyperbolic sine of pi is close to " (sinh "3.14") "." "\n" "\n" "\n" "\n" "\n")
mbutterick commented 8 years ago (Migrated from github.com)

Thanks. The tutorial reflected outdated behavior. Originally, pollen/markup would convert numbers automatically, but it doesn't any longer. I've changed the tutorial to show the correct behavior.

Additionally, the error ("is not a list starting with a symbol") was misleading, so I've improved that too.

Thanks. The tutorial reflected outdated behavior. Originally, `pollen/markup` would convert numbers automatically, but it doesn't any longer. I've changed the tutorial to show the correct behavior. Additionally, the error ("is not a list starting with a symbol") was misleading, so I've improved that too.
th commented 8 years ago (Migrated from github.com)

Hi,

just a quick followup question: why did it work with my “define pi 3“ then? Is that some other numeral type that happens to work there?

Happy New Year!

Thomas

Von: Matthew Butterick [mailto:notifications@github.com]
Gesendet: Donnerstag, 31. Dezember 2015 21:00
An: mbutterick/pollen pollen@noreply.github.com
Cc: Thomas Hühn t@2uo.de
Betreff: Re: [pollen] Example 7.6.1 (Third Tutorial) not working here (#106)

Thanks. The tutorial reflected outdated behavior. Originally, pollen/markup would convert numbers automatically, but it doesn't any longer.

Additionally, the error ("is not a list starting with a symbol") was misleading, so I've improved that too.


Reply to this email directly or view it on GitHub https://github.com/mbutterick/pollen/issues/106#issuecomment-168240109 . https://github.com/notifications/beacon/AAJZjCra3Feefui5MBGNMiIA-4kC8bWHks5pVYDNgaJpZM4G9PD5.gif

Hi, just a quick followup question: why did it work with my “define pi 3“ then? Is that some other numeral type that happens to work there? Happy New Year! Thomas Von: Matthew Butterick [mailto:notifications@github.com] Gesendet: Donnerstag, 31. Dezember 2015 21:00 An: mbutterick/pollen pollen@noreply.github.com Cc: Thomas Hühn t@2uo.de Betreff: Re: [pollen] Example 7.6.1 (Third Tutorial) not working here (#106) Thanks. The tutorial reflected outdated behavior. Originally, pollen/markup would convert numbers automatically, but it doesn't any longer. Additionally, the error ("is not a list starting with a symbol") was misleading, so I've improved that too. — Reply to this email directly or view it on GitHub https://github.com/mbutterick/pollen/issues/106#issuecomment-168240109 . https://github.com/notifications/beacon/AAJZjCra3Feefui5MBGNMiIA-4kC8bWHks5pVYDNgaJpZM4G9PD5.gif
mbutterick commented 8 years ago (Migrated from github.com)

Certain ranges of integers are valid as numeric entities within X-expressions (see docs for valid-char?). IIRC this is why I changed the automatic string-conversion behavior — otherwise there would be no way to embed these entities.

The number 3 works because it happens to be a valid-char?. But 3.1, for instance, is not.

Certain ranges of integers are valid as numeric entities within X-expressions (see docs for [`valid-char?`](http://docs.racket-lang.org/xml/index.html?q=valid-char%3F#%28def._%28%28lib._xml%2Fmain..rkt%29._valid-char~3f%29%29)). IIRC this is why I changed the automatic string-conversion behavior — otherwise there would be no way to embed these entities. The number `3` works because it happens to be a `valid-char?`. But `3.1`, for instance, is not.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#106
Loading…
There is no content yet.