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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -