Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

REPL result formatting ambiguously renders scalars and sequences with square brackets

Đang mở
#1,575 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, jupyter
Lĩnh vực
cli

Hướng nghiên cứu

Start by locating the REPL/Jupyter result-formatting entry point; the issue does not name a source file or test. Compare how add(2, 2), 2+2, and (1, 2) are rendered, then check whether existing tests cover scalar and sequence results. Done means the output distinguishes the explicitly scalar result from the sequence, or documents the display notation and explains the difference described in the issue.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

question

Summary

The REPL/Jupyter output uses square brackets for both a scalar calculation call and a sequence result. This makes the displayed values ambiguous as SysML values: a scalar Integer calculation appears as [4], while a sequence written with parenthesized comma syntax appears as [1, 2]. By contrast, ordinary arithmetic is displayed as an unbracketed scalar (4).

Reproduction

Observed with OpenSysML 0.11.0 using the SysML v2 (OpenSysML 0.11 experiment) Jupyter kernel:

private import ScalarValues::*;
calc add { in x : Integer; in y : Integer; return : Integer; x + y }
add(2, 2)

The call evaluates to:

✓ add(2, 2)
  = [4]

The declaration explicitly types both inputs and the return value as Integer. For comparison, 2+2 displays as = 4, while (2 + 2) also displays as = 4.

A sequence expression:

(1, 2)

is displayed as:

✓ (1, 2)
  = [1, 2]

Why this is confusing

In KerML textual syntax, (1, 2) is a sequence expression, whereas square brackets are used for distinct source constructs (including multiplicity ranges and the bracket expression form). Seeing [4] for an explicitly scalar return value suggests it may be a collection, and seeing [1, 2] does not preserve the source notation or distinguish the runtime sequence from other bracket constructs.

The question is about REPL result presentation, not a claim that the evaluated scalar or sequence has the wrong value. Could the output distinguish scalar values from sequence values, or document the brackets as a separate display notation? If the scalar call is intentionally returned as a one-item sequence, it would be helpful to explain why that differs from evaluating the same arithmetic directly.

Ngôn ngữ chính
Go
Star
47
Fork
13
Merge trung bình
15 giờ 13 phút
Pull request đã merge (30 ngày)
928

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Open-MBEE/OpenSysML

Tất cả issue của Open-MBEE/OpenSysML

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.