如何创建项目并将其添加到字典

时间:2019-06-11 13:17:35

标签: dictionary hashmap racket

我试图用以下代码创建一个字典或哈希表,其中键是字符串,值是整数:

slackEvents.on('im_open', (event: any, body: any, headers: any) => {
  console.log('Test'); // Doesn't work
});

slackEvents.on('message', (event: any, body: any, headers: any) => {
  console.log('Test2'); // Works fine
});

但是,它给出以下错误:

<select>
  <option value>Some nill value label</option>
  <option value="1">Option one</option>
  <optgroup label="Option Group 1" class="css-class-for-option-group-1">
    <option value="1:1">Option one in group 1</option>
    <option value="1:2">Option two in group 1</option>
  </optgroup>
  <optgroup label="Option Group 2" class="css-class-for-option-group-2">
    <option value="2:1">Option one in group 2</option>
    <option value="2:2">Option two in group 2</option>
  </optgroup>
</select>

问题出在哪里,如何解决?

1 个答案:

答案 0 :(得分:1)

问题在于文字#()是一个空向量。

要创建可变的哈希表,请使用(make-hash)

 (define dict (make-hash))