Opened 7 years ago

Closed 4 years ago

#1435 closed defect (wontfix)

getstr function in ncurses egg

Reported by: andrea Owned by: felix winkelmann
Priority: not urgent at all Milestone: someday
Component: extensions Version: 4.13.0
Keywords: ncurses Cc:
Estimated difficulty: easy

Description

Hi,
I'm not expert about Chicken Scheme and easyffi, so I tried to read the source of the ncurses egg but I did not come up with it.
I'm using Chicken 4.13 and the last version of the egg (i.e. 1.6) installed with "chicken-install ncurses".
The problem is this:

(require-extension ncurses)

(let ((stdscr (initscr)) (str (make-string 10)))
  (getstr str)
  (addstr str)
  (getch))

The error is this:

Error: bad argument type - not a pointer: "          "

It has been a similar problem: https://bugs.call-cc.org/ticket/158#no2
but it says that it has been solved now (but I still obtain an error, different from the one mentioned).

Change History (4)

comment:1 Changed 7 years ago by megane

Using make-locative from lolevel works: (getstr (make-locative str)).

comment:2 Changed 7 years ago by andrea

Is this the correct behaviour? Have I to close the ticket?

comment:3 Changed 4 years ago by felix winkelmann

Owner: set to felix winkelmann
Status: newaccepted

comment:4 Changed 4 years ago by felix winkelmann

Resolution: wontfix
Status: acceptedclosed

Yes, this is actually the correct behaviour. We can't just pass a string, as it will be copied and modifications will not be reflected in the passed argument. A better API would handle that, but that would be backwards-incompatible. So megane's suggestion is the obscure, but correct, answer.

Sorry for taking 3 years to answe. It was simply forgotten...

Note: See TracTickets for help on using tickets.