Example 7.6.1 (Third Tutorial) not working here
#106
Closed
opened 9 years ago by th
·
3 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
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")
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.
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
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 avalid-char?
. But3.1
, for instance, is not.