Hi,
I was trying to achieve something similar but found a problem in my code.
I'll be glad if someone can help me solve this.
The idea is that I want to define a typed function and then I want to
access the parameter types to define a different function. The file
containing the macro stuff is:
;
It would be useful in the case of designing macros. The macro could make
decisions based not only on syntax but on type.
Although to be honest (and to answer Robby's earlier question) I came
across this while avoiding a longer but better way to design my program.
--Spencer
On Mon, Jun 16, 2014
On Jun 16, 2014, at 3:41 PM, Sam Tobin-Hochstadt wrote:
> On Mon, Jun 16, 2014 at 3:29 PM, Alexander D. Knauth
> wrote:
>>
>> On Jun 16, 2014, at 3:13 PM, Sam Tobin-Hochstadt
>> wrote:
>>
>>> On Mon, Jun 16, 2014 at 3:06 PM, Alexander D. Knauth
>>> wrote:
> Typed Racket functions
On Mon, Jun 16, 2014 at 3:29 PM, Alexander D. Knauth
wrote:
>
> On Jun 16, 2014, at 3:13 PM, Sam Tobin-Hochstadt wrote:
>
>> On Mon, Jun 16, 2014 at 3:06 PM, Alexander D. Knauth
>> wrote:
>>>
Typed Racket functions are
just plain Racket functions. We could add some extra metadata to ev
On Jun 16, 2014, at 3:13 PM, Sam Tobin-Hochstadt wrote:
> On Mon, Jun 16, 2014 at 3:06 PM, Alexander D. Knauth
> wrote:
>>
>>> Typed Racket functions are
>>> just plain Racket functions. We could add some extra metadata to every
>>> value that held its type,
>>
>> It wouldn’t have to be every
On Mon, Jun 16, 2014 at 3:06 PM, Alexander D. Knauth
wrote:
>
>> Typed Racket functions are
>> just plain Racket functions. We could add some extra metadata to every
>> value that held its type,
>
> It wouldn’t have to be every value, it could just put that information in for
> :has-type expressi
On Jun 16, 2014, at 2:53 PM, Sam Tobin-Hochstadt wrote:
> This is exactly what predicates are for, in general. However, you
> can't have predicates that check things about functions -- there's no
> information there at runtime to look at.
I was kind of wondering if there was anything that coul
This is exactly what predicates are for, in general. However, you
can't have predicates that check things about functions -- there's no
information there at runtime to look at. Typed Racket functions are
just plain Racket functions. We could add some extra metadata to every
value that held its typ
Would there be a way to test the type for making decisions at run-time (not
just with predicates)?
For example:
(cond [(:has-type? f (Number -> Any))
(f 1)]
[(:has-type? f (String -> Any))
(f "1")])
On Jun 16, 2014, at 6:54 AM, Matthias Felleisen wrote:
>
> That's what I t
That's what I thought you wanted it for so my answer stands -- Matthias
On Jun 15, 2014, at 12:55 AM, Spencer Florence wrote:
> This is about making decisions at compile time. Specifically I have a
> sequence of expressions I want to partition into expressions of some type T
> and expression
This is about making decisions at compile time. Specifically I have a
sequence of expressions I want to partition into expressions of some type T
and expressions of other types.
On Sat, Jun 14, 2014 at 7:34 PM, Robby Findler
wrote:
> Would it be enough to expand into an 'ann' expression? Or do
Would it be enough to expand into an 'ann' expression? Or do you need
to make decisions at compile time based on whether or not the types
worked?
Robby
On Sat, Jun 14, 2014 at 2:04 PM, Matthias Felleisen
wrote:
>
> No, TR expands first, then checks. -- Matthias
>
>
>
>
> On Jun 14, 2014, at 2:59
No, TR expands first, then checks. -- Matthias
On Jun 14, 2014, at 2:59 PM, Spencer Florence wrote:
> Hey All,
>
> I'm trying to take advantage of typed/racket in a few macros. Is there any
> way to check the type of an expression from its syntax object? something like:
>
> (:has-type? (->
13 matches
Mail list logo