question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change `.t` to `.elem_type`

See original GitHub issue

The classes that represent collection types (TBag, TSet, and TList) use the attribute t for the type of their elements. This is ugly and is a bad name.

We should rename t to elem_type. This will be a wide-reaching change and we should be careful we got it right. Python’s untyped nature makes it tricky.

Similarly, we might also want to perform these other renamings:

  • ETupleGet.n --> .index
  • EGetField.f --> .field_name
  • SDecl.id --> .var (and change its type from str to EVar)
  • SForEach.id --> .loop_var
  • T and F --> ETRUE and EFALSE

(This is a follow-up to #43 and #44.)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
Calvin-Lcommented, Jul 26, 2018

No, most of the fs are functions. So perhaps:

  • EArg{Min,Max}.f --> .key_function (reminiscent of key in Python’s min, max, and sorted functions)
  • ELet.f --> .body_function
  • EMakeMap2.value --> .value_function
0reactions
anhnamtrancommented, Jul 30, 2018

Everything should be covered in #47.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Value of type 'T' cannot be converted to - Stack Overflow
Coming from a C++ background I have expected this to work. However, it fails to compile with "Cannot implicitly convert type 'T' to...
Read more >
jdk7u-langtools/Types.java at master · openjdk-mirror ... - GitHub
This code and its internal interfaces are subject to change or. * deletion without notice. ... return isSubtypeUnchecked(elemtype(t), elemtype(s), warn);.
Read more >
Stack Overflow Isn't Very Welcoming. It's Time for That to ...
Let's do something about comments. Condescension and sarcasm have been reluctantly tolerated in comments for too long. We'll research possible ...
Read more >
C语言typedef int ElemType替换问题-编程语言-CSDN问答
将实验中: typedef struct node{ //定义数据元素类型 int num; //学号 char name[10]; //姓名 float s; //成绩 }ElemType;. 替换为: typedef int ElemType; //定义数据 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found