Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-03

Parsing Smalltalk-style numbers

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

Does anybody have any Pascal code to hand which will parse Smalltalk-style numbers, i.e. written with an explicit radix indicator?

For example, 8r34.1 (octal) parses to 28.125 (decimal) and 2r11e6 parses to 192 (examples from the Smalltalk "Blue Book").

I know it's not too difficult, I'm just trying to save myself a bit of work if possible.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email