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
Post a Comment