s2k

s2k

Author of Fast Feedback Using Ruby

Seven Obscure Languages in Seven Weeks: 'Writing Comments & "Hello World!" p. 3 & 4 (in PDF)

The book shows an interactive session like this:

1↩ ok 1
2↩ ok 2
"Hello"↩ ok 4
'W'↩ ok 5
BYE↩

However, when I try this (on both macOS & Linux (Mint), I get the following:

~$ gforth
Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
1  ok
2  ok
"Hello" 
:3: Undefined word
>>>"Hello"<<<
Backtrace:
$7FE7BE18FA68 throw 
$7FE7BE1A5DF0 no.extensions 
$7FE7BE18FD28 interpreter-notfound1 
'W'  ok
bye 
~$ gforth -v
gforth 0.7.3

The stack depth isn’t displayed anymore, and entering a String (with more than one character) causes an error and a stack trace.

Is this a mistake in the book? A bug in the Forth implementation? A misunderstanding on my side?

First Post!

aqsaqal

aqsaqal

Author of Pythonic Programming (+ 3 other titles)

There are several current gforth implementations. The most recent one, 0.7.9 used in the book, allows string literals in quotation marks. The more “classical” one, 0.7.3, the one that you use, defines strings with a Forth word s": s" Hello". I am sorry about this confusion. I will add a note to the next edition.

Where Next?

Popular Pragmatic Bookshelf topics Top

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
jimschubert
In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New
telemachus
Python Testing With Pytest - Chapter 2, warnings for “unregistered custom marks” While running the smoke tests in Chapter 2, I get these...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=&gt; (create-...
New
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
New
rainforest
Hi, I’ve got a question about the implementation of PubSub when using a Phoenix.Socket.Transport behaviour rather than channels. Before ...
New
jwandekoken
Book: Programming Phoenix LiveView, page 142 (157/378), file lib/pento_web/live/product_live/form_component.ex, in the function below: d...
New
New
mcpierce
@mfazio23 I’ve applied the changes from Chapter 5 of the book and everything builds correctly and runs. But, when I try to start a game,...
New

Other popular topics Top

AstonJ
Or looking forward to? :nerd_face:
483 11078 254
New
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
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
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
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
RobertRichards
Hair Salon Games for Girls Fun Girls Hair Saloon game is mainly developed for kids. This game allows users to select virtual avatars to ...
New

Sub Categories: