poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Co-developing C and Poke: a practical session tonight


From: Jose E. Marchesi
Subject: Re: Co-developing C and Poke: a practical session tonight
Date: Sun, 04 Apr 2021 02:04:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Hi people!
>
> Tonight I will be adding support for a new kind of terminal hyperlink to
> poke.

And that support is now in master :)

Example usage:

  (poke) hserver_print_hl ('c', "clickme\n", "[say hola]", lambda void: { print 
"hola\n"; })
  clickme
  -------

Now click on `clickme'.  Every time you click you will see something
like this:

  (poke) [say hola]
  hola

Note that for 'c' hyperlinks the `cmd' argument to hserver_print_hl
contains a hint string that is printed after the (poke) prompt, and its
purpose is to help the user to not get lost about what action got
executed to provide that output.  It can of course be the empty string.
I think using [...] is a nice convention for that.

To get a new prompt every time a 'c' hyperlink gets executed, even if
the hint string is empty, is useful so the user can know (and "feel")
that something actually got executed.  I would like to hear opinions
about this.

To see why it is important to provide string hints: I intend to add
support for the PVM values printer to emit hyperlinks when it emits
... due to `set odepth' or `set oacutoff'.  A session will look like
this:

  (poke) .set odepth 1
  (poke) .set oacutoff 2
  (poke) type Foo = struct { byte[10] f1; }
  (poke) type Bar = struct { Foo foo; int f2; }
  (poke) Bar {}
  Bar {
    foo=Foo {...},
    f2=0x0
  }

Then the user clicks on the ... above:

  (poke) [foo]
  Foo {
    f1=[0x0UB,0x0UB,...]
  }

Then the user clicks on the ... above:

  (poke) [f1]
  [0x0UB,0x0UB,0x0UB,0x0UB,0x0UB,0x0UB,0x0UB,0x0UB,0x0UB,0x0UB]

NOW we can add toolbars in the CLI and other nice stuff using both C and
Poke :))

Thanks to SAL9000 and Bruno Haible for their nice suggestions and
comments during the call.

Salud!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]