comp.lang.ada
 help / color / mirror / Atom feed
* Record operations (Algebraic Data Types and printing)
@ 2018-10-05 17:46 Henrik Härkönen
  2018-10-05 17:58 ` AdaMagica
  2018-10-05 18:32 ` Niklas Holsti
  0 siblings, 2 replies; 43+ messages in thread
From: Henrik Härkönen @ 2018-10-05 17:46 UTC (permalink / raw)


Hi! (Very) Slowly getting my Ada wheels rolling, didn't get the book yet etc. but anyway...

I'm coming from Scala world most recently and I like to leverage Algebraic Data Types (through sealed traits), or Discriminated Unions, as they were called in F#. I was happy to find out that Ada has Variant Record, which I believe pretty much covers the same thing. Maybe in a bit more verbose way. :) I'm somehow fascinated by the possibility to carry state as the type, thus with different data items for each state.

Now as I'm playing with the records, I'd like to print them out, just for "debugging" purposes. Is there any convenient way to splash them out in console? Some sort of default string representation? Seems that 'Image attribute works only for scalar types.

-Henrik

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2018-10-12 19:20 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-05 17:46 Record operations (Algebraic Data Types and printing) Henrik Härkönen
2018-10-05 17:58 ` AdaMagica
2018-10-05 18:11   ` Henrik Härkönen
2018-10-05 18:46     ` Niklas Holsti
2018-10-05 20:33       ` Henrik Härkönen
2018-10-06  5:38   ` J-P. Rosen
2018-10-06  7:08     ` Henrik Härkönen
2018-10-06 16:42       ` Lucretia
2018-10-08 23:08         ` Randy Brukardt
2018-10-09  1:12           ` Lucretia
2018-10-09 22:20             ` Randy Brukardt
2018-10-10  7:17               ` Dmitry A. Kazakov
2018-10-10 18:13                 ` G. B.
2018-10-10 18:36                   ` Dmitry A. Kazakov
2018-10-11 11:29                   ` Björn Lundin
2018-10-11 14:45                     ` Jacob Sparre Andersen
2018-10-11 18:34                       ` Björn Lundin
2018-10-12 19:08                     ` G. B.
2018-10-12 19:20                       ` Randy Brukardt
2018-10-11 21:32                   ` Randy Brukardt
2018-10-10 18:38                 ` Shark8
2018-10-11  8:36                   ` Dmitry A. Kazakov
2018-10-11 21:35                 ` Randy Brukardt
2018-10-12  7:14                   ` Dmitry A. Kazakov
2018-10-12 19:16                     ` Randy Brukardt
2018-10-06 16:18     ` Jeffrey R. Carter
2018-10-06 17:19       ` Dmitry A. Kazakov
2018-10-08 23:03   ` Randy Brukardt
2018-10-09  6:22     ` Henrik Härkönen
2018-10-09  7:32       ` Paul Rubin
2018-10-09  7:38         ` Henrik Härkönen
2018-10-09 22:25         ` Randy Brukardt
2018-10-05 18:32 ` Niklas Holsti
2018-10-05 18:43   ` Henrik Härkönen
2018-10-05 19:41   ` Simon Wright
2018-10-06  6:17     ` Henrik Härkönen
2018-10-06 16:04       ` Stephen Leake
2018-10-06 16:56         ` Simon Wright
2018-10-08  6:44           ` briot.emmanuel
2018-10-08 14:09             ` Simon Wright
2018-10-08 14:21               ` Bill Findlay
2018-10-08 14:42                 ` Simon Wright
2018-10-08 16:46                   ` Bill Findlay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox