我想在F#中實現一個類型Symbol,它有一個關聯的字符串和位置(比如說文本中的行號)。我會做如下: type Symbol = Symbol of string * int // (string, line number)
我想要一個自定義的平等,關閉行號。我會有一個「嚴格的平等」,考慮到行號,但我希望默認的平等比較隻字符串。看着this SO post,似乎一個人必須做如下: [<Cust
我想從python中的文件中讀取數據,並比較它是否與某些信息匹配。我有這個 with open("data.dat", "r") as f: #read data in from the file
for line in f:
if line is "Static": #this adds the data for the static attack
當我從我的文件中讀取