Fieldname#- defining struct in racket -


assuming have following code in racket:

(struct st ( field1 field2# ))  

what # mean?

nothing, it's part of name field2#. racket allows symbols used in names. that's why you've got things hash-ref! , number? ordinary functions, despite having unusual symbols.

you can access , set other field:

(struct st (field1 field2#)) (define (st 1 2)) (st-field1 a) (st-field2# a) 

this prints out

1 2 

in drracket repl, expect of ordinary struct fields.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -