Opened 5 years ago

Closed 5 years ago

#1274 closed defect (fixed)

read-all receiving #<unspecified> unless preceded by a predicate

Reported by: sjamaan Owned by:
Priority: major Milestone: 4.11.0
Component: unknown Version: 4.10.x
Keywords: Cc:
Estimated difficulty:

Description (last modified by sjamaan)

This happens in csi:

;; This works:
(require-extension utils)

(define (command/string command)
  (define-values (proc-output proc-input proc-id) (process command))
  (port? proc-output)
  (define retval (read-all proc-output))
  (close-input-port proc-output)
  (close-output-port proc-input)
  retval)

(print (command/string "ls"))
;; This breaks:

(require-extension utils)

(define (command/string command)
  (define-values (proc-output proc-input proc-id) (process command))
  (define retval (read-all proc-output))
  (close-input-port proc-output)
  (close-output-port proc-input)
  retval)

(print (command/string "ls"))

;; Gives us:
;; Error: (open-input-file) bad argument type - not a string: #<unspecified>

Change History (4)

comment:1 Changed 5 years ago by sjamaan

Description: modified (diff)

comment:2 Changed 5 years ago by sjamaan

Summary: read-all receiving #<unspecified> unless preceded by a precidateread-all receiving #<unspecified> unless preceded by a predicate

comment:3 Changed 5 years ago by evhan

Transcribed from IRC: basically, ##sys#canonicalize-body reorders
internal definitions so that multi-valued assignments always follow
normal ones. The result is always a bunch of let bindings to introduce
the vars followed by a bunch of ##core#set! nodes to assign them,
but the normal and multi-valued var/val pairs are accumulated in
separate lists so the ordering gets lost. Then, the templating just
blindly puts the multi-valued ##core#sets! after the others.
Currently, the "dimensions" of the lists are different, so to speak --
in the code, vars/vals gets a list of variables/expressions, whereas
mvars/mvals gets a list of lists of variables/expressions -- and
mvars/mvals has to be processed a bit more to produce a c-w-v.

Version 0, edited 5 years ago by evhan (next)

comment:4 Changed 5 years ago by evhan

Resolution: fixed
Status: newclosed

Fixed by 469f2bb / 6992762.

Note: See TracTickets for help on using tickets.