Re: What have you done with UDAs?

2015-06-25 Thread Jonas Drewsen via Digitalmars-d
On Monday, 22 June 2015 at 20:29:15 UTC, Jonas Drewsen wrote: On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I use a few in the deadcode editor e.g.: Function can be called by a menu entry:

Re: What have you done with UDAs?

2015-06-23 Thread Tofu Ninja via Digitalmars-d
On Tuesday, 23 June 2015 at 06:43:21 UTC, Rikki Cattermole wrote: I am currently writing a ui system that defines the majority of the layout in a dsl. The ui element types are defined in D code and I use uda's to mark which fields can be accesses by the dsl. Got a repo yet? Would be intereste

Re: What have you done with UDAs?

2015-06-23 Thread Andrei Alexandrescu via Digitalmars-d
On 6/23/15 8:05 AM, Alex Parrill wrote: (somewhat related: std.getopts is kinda bad; you can't get help text without successfully parsing arguments and `required` breaks `--help`) Could you please submit these as bug reports at http://issues.dlang.org - thanks! -- Andrei

Re: What have you done with UDAs?

2015-06-23 Thread Alex Parrill via Digitalmars-d
On Tuesday, 23 June 2015 at 14:52:30 UTC, Dmitry Olshansky wrote: An example command: @("") // arguments @("Sets the amount of time to increment the clock on each frame.") // description @ShellOnly // can't be ran from command line int cmd_set_time_per_frame(string[] args) { // ... } Aw

Re: What have you done with UDAs?

2015-06-23 Thread Dmitry Olshansky via Digitalmars-d
On 22-Jun-2015 22:21, Alex Parrill wrote: On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I'm writing a program that can accept subcommands via either the command line (ex. `prog mycmd 1 2`) o

Re: What have you done with UDAs?

2015-06-23 Thread Random D-user via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? What a cool thread. This is very valuable info for new(ish) d users. It's often the case for language features that they are just branded cool.

Re: What have you done with UDAs?

2015-06-23 Thread John Colvin via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? Amongst other things, I use them in PydMagic to mark functions to be wrapped by pyd and exposed to the python.

Re: What have you done with UDAs?

2015-06-23 Thread ponce via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I've used them along with reflection to describe OpenGL vertex formats from a struct. https://github.com/d-gamedev-team/gfm/blob/master/opengl/

Re: What have you done with UDAs?

2015-06-23 Thread Vladimir Panteleev via Digitalmars-d
On Monday, 22 June 2015 at 19:36:59 UTC, Kapps wrote: On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? Like several others, I use them for generating command line interfaces to set variables /

Re: What have you done with UDAs?

2015-06-23 Thread via Digitalmars-d
I use them in a simple MongoDB-based ORM, not (yet?) publically available. Usage is like this: @Collection("my.model") struct MyModel { @Field @Required @Index BsonObjectID foreignKey; @Field string someOptionalString; @Field @Required int[] someRequiredArray; @Fiel

Re: What have you done with UDAs?

2015-06-23 Thread Mathias Lang via Digitalmars-d
I use them all the time in vibe.web.rest. It allows to override the defaults (e.g. by default `getfoo` maps to `GET /foo`): https://github.com/Geod24/vibe.d/blob/ea061223ab96d5acdc004e9369f904c5e25ec8d0/source/vibe/web/rest.d#L60-L66 I actually really, really miss attributed parameters. Obviously i

Re: What have you done with UDAs?

2015-06-23 Thread extrawurst via Digitalmars-d
On Monday, 22 June 2015 at 20:57:59 UTC, Brian Schott wrote: On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? Semi-hijacking this thread: I recently made a few pull requests to get better supp

Re: What have you done with UDAs?

2015-06-22 Thread Rikki Cattermole via Digitalmars-d
On 23/06/2015 7:09 a.m., weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? Dvorm and Cmsed used them. Both for routing and data models. (They are both sunsetted right now btw)

Re: What have you done with UDAs?

2015-06-22 Thread Rikki Cattermole via Digitalmars-d
On 23/06/2015 7:43 a.m., Tofu Ninja wrote: On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I am currently writing a ui system that defines the majority of the layout in a dsl. The ui element t

Re: What have you done with UDAs?

2015-06-22 Thread Manu via Digitalmars-d
On 23 June 2015 at 05:09, weaselcat via Digitalmars-d wrote: > I never seem to use them for anything, has anyone else done anything > interesting with them? I've used them for attributing struct members with some information about their semantic meaning, which allows systems to automatically bind

Re: What have you done with UDAs?

2015-06-22 Thread Basile Burg via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I use them to annotate the setter/getter pairs in classes. Two analyzers look for them to automatically create what i call a "property descript

Re: What have you done with UDAs?

2015-06-22 Thread E.S. Quinn via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I use UDAs in my project to generate GTK UI for editing components in my ECS. (For things like marking string fields as filenames, or giving nu

Re: What have you done with UDAs?

2015-06-22 Thread Brian Schott via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? Semi-hijacking this thread: I recently made a few pull requests to get better support for UDAs into Phobos. https://github.com/D-Programming-

Re: What have you done with UDAs?

2015-06-22 Thread Jonas Drewsen via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I use a few in the deadcode editor e.g.: Function can be called by a menu entry: @MenuItem("Edit/Copy") Function can be called by a shortcut: @

Re: What have you done with UDAs?

2015-06-22 Thread Jacob Carlborg via Digitalmars-d
On 22/06/15 21:09, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? Serialization: https://github.com/jacob-carlborg/orange/blob/master/tests/NonSerialized.d#L25-L39 Selectors in D/Objective-C. It's actually a compiler recognized UD

Re: What have you done with UDAs?

2015-06-22 Thread extrawurst via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? They are great! see my post about one use case: http://extrawurst.github.io/dlang/metaprogramming/imgui/2015/05/28/dlang-annotations.html

Re: What have you done with UDAs?

2015-06-22 Thread Tofu Ninja via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I am currently writing a ui system that defines the majority of the layout in a dsl. The ui element types are defined in D code and I use uda's

Re: What have you done with UDAs?

2015-06-22 Thread Kapps via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? Like several others, I use them for generating command line interfaces to set variables / invoke methods using reflection. For example https:/

Re: What have you done with UDAs?

2015-06-22 Thread Nick Sabalausky via Digitalmars-d
On 06/22/2015 03:18 PM, Ilya Yaroshenko wrote: On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? UDAs are very useful for IO libraries. You can find them in vibe.d web server: http://d.readthedo

Re: What have you done with UDAs?

2015-06-22 Thread Atila Neves via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I use them all the time: https://github.com/atilaneves/unit-threaded https://github.com/atilaneves/cerealed https://github.com/atilaneves/unencu

Re: What have you done with UDAs?

2015-06-22 Thread Alex Parrill via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I'm writing a program that can accept subcommands via either the command line (ex. `prog mycmd 1 2`) or via a shell. I represent each command a

Re: What have you done with UDAs?

2015-06-22 Thread Ilya Yaroshenko via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? UDAs are very useful for IO libraries. You can find them in vibe.d web server: http://d.readthedocs.org/en/latest/examples.html#service (see la

Re: What have you done with UDAs?

2015-06-22 Thread Dragos Carp via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? https://github.com/linkrope/dunit#user-defined-attributes

What have you done with UDAs?

2015-06-22 Thread weaselcat via Digitalmars-d
I never seem to use them for anything, has anyone else done anything interesting with them?