[gambit-list] Printing unicode characters in Gambit

Adam adam.mlmb at gmail.com
Sun Jun 26 09:59:26 EDT 2016


Print going into a loop is not OK, I suppose Marc fixes that.

Needing a switch for switching on Unicode is OK though. When that option is
off, you could do your prints by serializing to UTF8 binary yourself and
then writing it byte by byte to the console.

2016-06-26 13:21 GMT+08:00 Vijay Mathew <vijay.the.lisper at gmail.com>:

> Thanks Adam, will try what you suggested. But I really don't understand
> why a special switch is required to properly print Unicode characters. Even
> if the user is unaware of this, 'print' going into a loop is bad behavior.
>
> --Vijay
>
> On Jun 26, 2016 8:26 AM, "Adam" <adam.mlmb at gmail.com> wrote:
>
>> You need to switch on unicode output for the output medium (gsc -t8) and
>> maybe also specify the maximum unicode character number that the writer
>> will accept to write. Please report back when you figured.
>>
>> 2016-06-26 10:34 GMT+08:00 Vijay Mathew <vijay.the.lisper at gmail.com>:
>>
>>> How can I make gambit to print a Unicode character's symbol (or glyph)?
>>> For example, I want to display the Unicode infinity symbol ∞ (#\u221E).
>>> Calling `(display #\u221E)` or `(print #\u221E)` throws the REPL into an
>>> infinite loop.
>>> (This happens for most Unicode literals I tried, not just the infinity
>>> symbol :-))
>>>
>>>        $ gsc
>>>        Gambit v4.8.4
>>>
>>> > (print #\u221E)
>>> *** ERROR IN ##wr-ch -- Can't convert to C char-string
>>> (write-char #\*** ERROR IN ##wr-ch -- Can't convert to C char-string
>>> (write-char #\*** ERROR IN ##wr-ch -- Can't convert to C char-string
>>> (write-char #\*** ERROR IN ##wr-ch -- Can't convert to C char-string
>>> (write-char #\*** ERROR IN ##wr-ch -- Can't convert to C char-string
>>>
>>> Thanks,
>>>
>>> --- Vijay
>>>
>>>
>>> _______________________________________________
>>> Gambit-list mailing list
>>> Gambit-list at iro.umontreal.ca
>>> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20160626/fce6a063/attachment.htm>


More information about the Gambit-list mailing list