ikarus.io.ss bugs?

Bug #238400 reported by Derick Eddington
2
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
High
Abdulaziz Ghuloum

Bug Description

refill-bv-buffer: lines 714-716 use j but should they be using c1?

lookahead-char-utf8-mode: line 840 uses get-char but should it be? get-char will see the same decoding error and ignore it by advancing passed it and doing another get-char which will advance more, but since this was lookahead-char should it be consuming characters? I.e.:

> (define tip (open-bytevector-input-port '#vu8(#b10000000 65 66 67) (make-transcoder (utf-8-codec) (eol-style none) (error-handling-mode ignore))))
> (lookahead-char tip)
#\A
> (lookahead-char tip)
#\B
> (lookahead-char tip)
#\B
>

I know the port position stuff is not finished, but I noticed these:

refill-bv-buffer: lines 706-708: should refilling the buffer be advancing the port's position?

Should these give 0?
> (input-port-byte-position (open-string-input-port "foobar"))
1
> (input-port-byte-position (open-bytevector-input-port '#vu8(1 2 3 4 5)))
1
>

Related branches

description: updated
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 238400] [NEW] ikarus.io.ss bugs?

> refill-bv-buffer: lines 714-716 use j but should they be using c1?

Fixed. Thanks.

> lookahead-char-utf8-mode: line 840 uses get-char but should it be?

Nop. It was supposed to be lookahead-char.

> I know the port position stuff is not finished, but I noticed these:
>
> refill-bv-buffer: lines 706-708: should refilling the buffer be
> advancing the port's position?

Yes, that's the only place where the port-position field advances.

> Should these give 0?
>> (input-port-byte-position (open-string-input-port "foobar"))
> 1
>> (input-port-byte-position (open-bytevector-input-port '#vu8(1 2 3
>> 4 5)))
> 1

I don't know. I added the 1 explicitly in line 239 (vi bias again).
BTW, this is not the port-position of R6RS, right?

Aziz,,,

Revision history for this message
Derick Eddington (derick-eddington) wrote :

> > Should these give 0?
> >> (input-port-byte-position (open-string-input-port "foobar"))
> > 1
> >> (input-port-byte-position (open-bytevector-input-port '#vu8(1 2 3
> >> 4 5)))
> > 1
>
> I don't know. I added the 1 explicitly in line 239 (vi bias again).
> BTW, this is not the port-position of R6RS, right?

Ah, I see where it's used now. My editor counts chars starting at 1 too, and all the character positions I've jumped to have been correct. I'm so used to thinking in 0-based indexing... :) just thought to mention it.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

I'm going to drop input-port-byte-position from the exports of (ikarus) because this is really an internal function.

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → High
status: New → Fix Committed
Changed in ikarus:
milestone: none → 0.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.