![]() aeth: Also, pick a domain that fits the language, if you're just learning it on your own. aeth: If foo is type Foo, then things are easy aeth: Might not work well in Ada specifically (see: the earlier conversation here) aeth: verisimilitude: give nearly everything its own type and if you change what its type is later on, you just change one line instead of many Codaraxis quit (Read error: Connection reset by peer) ahungry quit (Remote host closed the connection) I've been learning Ada for a while now and it's not always easy to plan a program out in the detail required, down to the types, and I'm inclined to believe being so accustomed to Common Lisp is part of the reason. verisimilitude: An issue with Lisp is that it can be odd moving to a new language. Josh_2 quit (Remote host closed the connection) I can do that in CL since my function takes in a quoted s-expression as its main input. aeth: And I wouldn't be able to trivially turn that into a syntactic macro. And visually, the end result would look pretty weird. aeth: And then I'd have to make a linked list where the head is one of those enums and the tail is either a string or another enum representing attributes (again, with me having to enumerate all of them instead of just using keywords). First, I'd have to make a gigantic enum of all of the tags instead of just using keywords that don't have to be aware of anything (with the exception of the HTML empty elements like br that turn into aeth: I was thinking about how I'd do the same thing in C++ and it's not pretty. aeth: And it's not much, I wrote something to generate HTML in a few days, with this test generation: aeth: So you get the full language, without the mess of having to embed it (and possibly escape certain characters) or using some DSL or something else. (:body (:p "Hello, " ,username "!"))) and generate the final HTML string at the end, after working on it structurally, perhaps in functions or perhaps in macros (or both!) aeth: emma: In a Lisp, you'd be more likely to do something like this: `(:html. Hello, ! might be what it looks like using something like
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |